We can create several users and profiles on an Android devices, for example, there is a Main User, and I also set a Work Profile with name "Work Profile".
Using the following adb command:
adb shell pm list users
I'm getting this result:
UserInfo{0:My User:13} running UserInfo{10:Work Profile:30} running
Good, I can see my User Info with the name Work Profile on it. Now, I want to get this list from my application.
I tried to use this code:
for(Account account: AccountManager.get(this).getAccounts()) {
DebugLog.e("COUCOU " + account.name + " " + account.toString());
}
But the Work Profile account is not appearing in the list. Only the main user... Any idea how I could get the same list as the ADB shell command??