I am using a Nexus 7 which is updated to Android 4.3. I have an application which requires Device Admin rights to Lock/ Wipe device. I have given Device Admin right to my application on Owner Profile. So when i switch to another user profile, i can see my application in list of Device Admin apps. However when i give a Lock command on this non Owner user profile, i get the exception as
"java.lang.SecurityException: No active admin owned by uid XXXXXX".
DevicePolicyManager isActiveAdmin ()
method also returns true on this profile still it fails to take action and crashes the application.
I assume that once device admin is set for Owner user profile, its automatically applied to all other user profiles.Any idea then why is this happening ? Also, is there any documentation that points out on what care should my application take in order to handle Multiple user profiles in case my app requires device admin rights