0

I am currently developing an android application that is supposed to run in kiosk mode. Everything else works well however, we have a lock screen issue, the application will e completely unmanned and therefore, the lockscreen prevents us from running upon restart.

I tried:

policy_name = enterprise_name + '/policies/policy1'

policy_json = 
{
  "applications": [
    {
      "packageName": "com.micro.buscamera",
      "installType": "KIOSK",
      "defaultPermissionPolicy": "GRANT"

    }
  ],
  "debuggingFeaturesAllowed": true,
  "maximumTimeToLock": "0"
}


androidmanagement.enterprises().policies().patch(
    name=policy_name,
    body=json.loads(policy_json)
).execute()

However, the maximumTimeToLock did not seem to work. Any and all suggestions will be highly appreciated

Robert
  • 39,162
  • 17
  • 99
  • 152

2 Answers2

1

"keyguardDisabled": true This option disables the lock screen but does not keep the screen from turning off. Alternatively you could try putting getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); in your app.

HapaxLegomenon
  • 111
  • 1
  • 7
0

To prevent your device from locking in right after you restart your device, I suggest that you remove your screen lock pin/password. With this, after the device restarted, it will continue to the home screen and will not be automatically locked.

After reboot you can continue using policies to prevent your device from locking out such as maximumTimeToLock or keyguardDisabled. If you still need to keep your device awake,your application can add the FLAG_KEEP_SCREEN_ON flag.

rsiason
  • 156
  • 5