I am trying to set up a program screen on Android L. My application includes an xml file with
<?xml version="1.0" encoding="utf-8"?> <device-admin xmlns:android="http://schemas.android.com/apk/res/android"> <uses-policies> <force-lock/> <watch-login/> <disable-camera/> <disable-keyguard-features/> <encrypted-storage/> <expire-password/> <limit-password/> <reset-password/> <set-global-proxy/> <wipe-data/> </uses-policies> </device-admin>
I installed the application with the corresponding lines in the AndroidManifest file, where I defined AdminReceiver. Everything went fine a few weeks ago, but now that Iโve returned to this project, the application will ask me to confirm the "Pin screen" popup every time the application starts.
When I debug, I noticed the strange behavior of devicePolicyManager.isAdminActive(componentName) true devicePolicyManager.isDeviceOwnerApp(getPackageName()) true
but
devicePolicyManager.isLockTaskPermitted(getPackageName()) false
It doesnโt matter if I install the application as the owner of the device using adb commend dpm set-device-owner ... or by clicking the device_owner.xml file in / data / system /
My question is: why the application does not have permission to lock the screen?
source share