I\'m new to Android and I have to do an application at work that performs the following task:
Did you manage to get the user names once you become the device owner ? getUserProfiles and getSecondaryUsers can be used, but they both return UserHandle. I can't get the user name registered at creation. It seems that the only way is to add the MANAGE_USERS permission to the manifest but that supposes the app to be a system app : https://developer.android.com/reference/android/os/UserManager#getUserName()
I think I will create a persistent list somewhere.
Haven't tried it myself but you should be able to get all UserHandle setup on the device and then use DevicePolicyManager switchUser() method.
UserManager um = (UserManager) getSystemService(USER_SERVICE);
List<UserHandle> userProfiles = um.getUserProfiles();
For this to work, you have to set your app as a device administrator (should not be a problem as you say it's an internal fully managed app)