Search code examples
androidmulti-userandroid-4.2-jelly-bean

Storage common to all users in android 4.2


4.2 Jellybean now supports multiple users. However as per the docs, all calls to all the APIs to get storage location return locations private to the current user (eg: getExternalStorageDirectory()).

I cache plenty of content from servers and store this to external storage, but with a multi user enviornment, this data will need to be duplicated for all users. This is wasting a lot of space.

Is there any way to store files to a common area for all users to make use of?


Solution

  • Apparently not, according to the release notes:

    No matter which of these APIs you use to save data for a given user, the data will not be accessible while running as a different user. From your app’s point of view, each user is running on a completely separate device.

    I hope I'm wrong because I have the same problem as you.

    I appreciate that it would have been a potential security hole, but if I saved files in the folder returned by getExternalStoragePublicDirectory, I would have only myself to blame.