How does the multi-user feature work in terms of paths on Android? -


background

starting version 4.2 , android supports multi-user (link here , here).

each user has apps , private data visible user.

the question

how encapsulation of data per user work in terms of paths , accessing files?

i mean, paths per each user for:

  1. the private, internal storage.
  2. the emulated external storage (built in external storage)
  3. the "real" external storage (sd cards)

?

i guess users can see data stored on sd cards belong other users, emulated external storage? , can write other users' files or read them?

does each user own special path automatically? or should developer handle this?

if developer needs handle it, should used id of user?

the documentation says:

no matter of these apis use save data given user, data not accessible while running different user.

but that's assuming use apis own path. apps somehow bypass going other paths?

what can app query each installation of on same device? can size of apps of other users? can list of apps of other users?

does multiple installation of same app take multiple size?

what paths per each user

if care, you're doing wrong. use android sdk apis determining base directories, , work there. so, example:

  • getfilesdir() return right location internal storage current user
  • getexternalfilesdir() , methods on environment return right locations external storage current user

i guess users can see data stored on sd cards belong other users

that outside bounds of android sdk, generally.

but emulated external storage?

each user gets own space.

and can write other users' files or read them?

neither, barring bugs in device.

does each user own special path automatically?

yes, if using android sdk apis determining base directories.

could apps somehow bypass going other paths?

no, because have neither read nor write access, barring bugs.

what can app query each installation of on same device?

afaik, nothing. app's standpoint, fact there several installations on 1 device indistinguishable being installed on several devices.

can size of apps of other users?

i not know mean "size of apps", sorry.

can list of apps of other users?

that's fine question. have not experimented packagemanager see exposes when used apps run secondary users. in theory, should report things available current user, particularly given android's restricted profiles.

does multiple installation of same app take multiple size?

the apk , pieces of unpacked (e.g., dex files) shared, understand it.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -