Skip to content

Conversation

@L-Henke
Copy link
Contributor

@L-Henke L-Henke commented Feb 16, 2015

Use Android 5 Storage Access Framework to select root folder. Use old
method on devices without Lollipop SDK.

This is an untested attempt to close #94. It uses the Storage Access Framework to select any folder as the secrecy root folder. The storage is not accessed by the Storage Access Framework but by the legacy way. I'm not sure if the app really has write right in that folder if it is accessed the legacy way. (Works on my OPO with CM12) If not, we might have to adapt all file operations to the new SAF, if available.

@Doplgangr
Copy link
Contributor

Works well on my Nexus 4 with Android 5.1
and Blackberry 10 (i.e. android 4.3 compatibility layer)

@Doplgangr
Copy link
Contributor

IMO IFF the user does not select a remote storage provider nothing should become problematic.

When I was using the SAF I don't see anything except my internal storage.

@L-Henke
Copy link
Contributor Author

L-Henke commented Feb 22, 2015

I have to think a little bit more about the content provider problem. We might need to find out if many apps have problems accessing files via the content provider. I only noticed VLC so far, but this might be a widespread problem.

@Doplgangr
Copy link
Contributor

@L-Henke L-Henke force-pushed the storageAccessFramework branch from bf0c32b to 77833f4 Compare March 15, 2015 11:29
@L-Henke L-Henke changed the title [NOT TO BE MERGED YET] Use Android 5 Storage Access Framework to select root folder Use Android 5 Storage Access Framework to select root folder Mar 15, 2015
@Doplgangr
Copy link
Contributor

I'm bumping this up. Since it loses the not ready tag does it mean that this PR is ready for merge?
(still, conflicts exist.)

I'd most welcome a word from @StelianMorariu and @laura-almieda on this

@StelianMorariu
Copy link
Contributor

I, personally, wouldn't have added the option to change the vaults directory. I would have just saved them directly on the external storage

Environment.getExternalStoragePublicDirectory(SECRECY_FOLDER)

I think disabling this feature is the fastest way to achieve a stable version of the app. Yes, I understand that some users may complain about it (how many ?) .

@L-Henke
Copy link
Contributor Author

L-Henke commented Mar 18, 2015

I don't think that we should remove existing features.
Further, the call does not necessary give you an sd card:

From the Android documentation:

Note: don't be confused by the word "external" here. This directory can better be thought as >media/shared storage. It is a filesystem that can hold a relatively large amount of data and that is >shared across all applications (does not enforce permissions). Traditionally this is an SD card, but it >may also be implemented as built-in storage in a device that is distinct from the protected internal >storage and can be mounted as a filesystem on a computer.

And as far as I remember, the problem with a stable and unified API to get the external storrage has only been added by Android 5.

@StelianMorariu
Copy link
Contributor

I know it's not guaranteed to be SD Card (and for ensuring that data is not saved on the internal storage it was enough for me).

If freezing a feature is not an option, maybe we could look at some file managers and see how they get around the problem.
I can think of :

  1. Amaze File Manager
  2. Sliding Explorer

Unfortunately I don't have any phones with SD cards, I'll try with Genymotion to see if it works.

@L-Henke
Copy link
Contributor Author

L-Henke commented Mar 18, 2015

Its not that removing a feature is generally not an option, but I think that users want to be able to select where their files are stored.

I also don't have a device with an SD card to test, only the android emulator. But as far as I know, Samsung devices are problematic, but I currently don't know the details.

Use Android 5 Storage Access Framework to select root folder. Use old
method on devices without Lollipop SDK.
@L-Henke L-Henke force-pushed the storageAccessFramework branch from 77833f4 to 5bff4de Compare March 21, 2015 11:52
Doplgangr added a commit that referenced this pull request May 27, 2015
Use Android 5 Storage Access Framework to select root folder
@Doplgangr Doplgangr merged commit f97168c into SecrecySupportTeam:master May 27, 2015
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.

Cannot access external SD card in Android 5

3 participants