I have a device owner app on Android, and would like to add an additional policy to device-admin.xml file. This is required because I want to disable camera on keyguard, which requires <disable-keyguard-features />
to be available inside the device-admin.xml. The app was initially installed using NFC and a new version of the app can be installed through a locally saved apk file, which can be downloaded from our private server, however, when the new version of app is installed it seems to have no impact on the addition of <disable-keyguard-features />
to device-admin.xml because we get a SecurityException on calling
aDevicePolicyManager.setKeyguardDisabledFeatures(aDeviceAdmin,
DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA);
Now, if we re-provision a device with new version of the owner app, using NFC then everything goes well, but I am looking for a way to apply this change to existing app, how can this be achieved?
In other words, how can we update policy requirements of a device owner app on an Android device without re-provisioning?