Questions tagged [android-multiple-users]

Questions regarding the particulars of the Android multiple users implementation.

Introduction

Since Jelly Bean (4.2) Android allows multiple users spaces on tablets. It means each user has his or her own set of accounts, apps, system settings, files, and any other user-associated data.

App developers are not supposed to do anything in order for apps to work properly, but in reality there are some issues to be discussed and not much official documentation about them.

When to use the tag

Issues directly related to multiple user environments that do need to be addressed by developers to ensure a good functionality of their apps.

39 questions
27
votes
5 answers

Get list of apps of all users

If I want to retrieve an ApplicationInfo list for all apps of the current user, I can just run: PackageManager pkgmanager = ctx.getPackageManager(); List installedApps =…
21
votes
1 answer

How to detect switching between users

I have a service running in foreground mode and I'd like to detect switching between user sessions on tablets running Android 4.2 or above. Is there any broadcast receiver I can register to get notified? I have noticed that Google Music stops the…
Xavi Gil
  • 11,460
  • 4
  • 56
  • 71
7
votes
1 answer

SecurityException: get application info: Neither user 1010069 nor current process has android.permission.INTERACT_ACROSS_USERS

I'm getting this weird crash. It seems like AlarmManager.set() cause this but I don't understand how nor why. Stack trace: Fatal Exception: java.lang.RuntimeException: Unable to create application com.rotem.appmanager.app.MainApplication:…
6
votes
3 answers

Prevent Android App from getting installed on multiple users

When I run my app from Android Studio and install it on the primary user on a device, I notice that it gets installed on the secondary user as well. In the first place, why is this happening? The android:requiredForAllUsers flag is false by default,…
Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
6
votes
0 answers

Relation between AlarmManager and INTERACT_ACROSS_USERS

We recently integrated with Crashlytics in Firebase and found that our app was facing this crash: Fatal Exception: java.lang.SecurityException get application info: Neither user 1010170 nor current process has…
5
votes
0 answers

Android 7.1.1 multi-user support in emulator

I tried to get the multi-user support for my Android 7.1.1 AOSP emulator build on Ubuntu 16.04 64bit. The build gets run with lunch aosp_x86-eng and following the emulator with emulator64-x86. I tried this solution but with no success: adb…
4
votes
0 answers

Google In-App Purchase how to set Account for Billing [Not Possible as of 2017-05-26]

Backstory I'm trying to implement Android's inapp billing for subscriptions. Surprisingly, It's going relatively smoothly, but I've hit a wall. What I'm trying to do is have multiple possible logins (using Google's standard stuff, which all works…
DMT
  • 73
  • 7
3
votes
3 answers

How to know if the android device supports multi users?

Android 4.2 supports multiple user spaces "on shareable devices such as tablets"(http://developer.android.com/about/versions/android-4.2.html#MultipleUsers). How do I know if a specific device is a "shareable device"? Can I programmatically check if…
prograde
  • 2,620
  • 2
  • 23
  • 32
2
votes
0 answers

Which is the best approach for an app with multiple users using Room database?

I'm developing an app (Android, Kotlin) that allows the user to register different documents with specific information in Room database. I'll implement in the app to only be able to display the files registered if the user is logged in. It concerns…
Tods
  • 37
  • 6
2
votes
1 answer

Can I make a shared folder in Android for multiple users?

In Android 29, I want to be able to share large files between multiple Android users. Is it possible to make a shared directory that users can access? And can that directory be made browse-able by applications that the users have installed? Or…
Jayae
  • 79
  • 2
  • 5
2
votes
1 answer

How to access personal file in SD card in work profile App?

According to Google's introduction https://developer.android.com/work/managed-profiles.html, personal files in SD cards are not accessible by work profile application. However, we can see all files in DocumentsUI(application provided by system) by…
2
votes
1 answer

Android for Work ANDROID_ID is returning NULL

I'm using the following code to get the device id: String androidID = Settings.Secure.getString(getActivity().getContentResolver(), Settings.Secure.ANDROID_ID); According to the doc here, ANDROID_ID value is unique to each user. What I found is…
Song
  • 504
  • 7
  • 17
2
votes
1 answer

Android: multiple-user how to change system locale/ language per single User

I'm working on the AOSP with multiple-user. I need to change the default system language (or locale) to single user, all my attempts change the entire system language for all users. I use the ActivityManagerNative class,…
1
vote
1 answer

Android: access SQLite database via Content Provider with multiple users in same application

My requirement is to create a sqlitedb which can be shared with any user who logs into the application. Looks like ContentProvider can be used only to share the db with other applications. Is there any way we can create the sqlitedb in /data/data/…
1
vote
2 answers

How to check if "Multiple users" is enabled

Is there a system setting table or API I can check to see if the "Multiple users" setting is turned on in Settings -> System -> Advanced -> Multiple users? Thanks!
Flyview
  • 1,899
  • 1
  • 28
  • 46
1
2 3