As a profile owner, I am trying to disable user addition and the code that I am using is
devicePolicyManager.addUserRestriction(myComponent, UserManager.DISALLOW_ADD_USER)
When I call this I get a security exception that says
Process: net.notify.notifymdm, PID: 32626
java.lang.SecurityException: Profile owners cannot set user restriction no_add_user
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1499)
The official documentation here says the caller must be Policy or Device owner. Is this a bug or am I doing something wrong here? The OS is 5.1