Skip to content

Conversation

brarcher
Copy link
Owner

No description provided.

Eventually the importer and exporter will need to support
content Uri's so the file argument will not make sense.
The caller should know what was imported and exported,
so moving that logic to the calling activity.
Starting in Android 7+ passing file Uris to other
activities is discouraged or prevented. To allow
exporting to work correctly, a FileProvider
is now used to pass backups to other activities.
For imports both file Uris and content Uris
are now supported.
On Android 7 it was found that the share button on
the receipt sharing activity was missing, because
ProGuard removed a needed class. This may not have
been caught when ProGuard was enabled, or it may
have been a changing requirement in Android 7.
Either way, ProGuard has caused a few issues thus far
with minimal benefit.
Starting in Android 24 file Uris cannot be used
outside of an Activity. To allow images to be
captured with a camera, a content Uri needs to be used.
This change will use a FileProvider on Android 24+.
For earlier versions the file Uri will still be used.
This provides backwards compatability, as well as allows
Robolectric to continue to test the general code path.
Previously backups were being reported as "text/plain",
which for CSV and JSON was not incorrect but it could
have been more specific, and for ZIP was incorrect.
Now the correct mime type will be used when sending
data to other activities.
This was added to prevent Android 7+ from complaining
when a file:// Uri is shared with another Activity.
This did not work on all Android devices that enforced
not sharing file:// Uris.

The issues have been resolved so this is no longer needed.
@brarcher brarcher merged commit 41f8a57 into master Nov 25, 2017
@brarcher brarcher deleted the content-provider branch November 25, 2017 01:51
@brarcher brarcher restored the content-provider branch November 26, 2017 01:24
@brarcher brarcher deleted the content-provider branch November 26, 2017 01:25
@brarcher brarcher restored the content-provider branch November 26, 2017 01:25
@brarcher brarcher deleted the content-provider branch November 26, 2017 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant