Screen lock not always working in Android kiosk mode

Viewed 21

We run an Android app in Kiosk mode that uses NFC tags.

When pressing the screen lock button, when in Kiosk mode sometimes the app doesn't enter screen lock mode, the screen goes black but you don't hear the normal click you get when locking, pressing screen lock again just returns straight to back the app without displaying the unlock screen and our NFC tags no longer work (separate Android issue).

If the user presses the home button beforehand, screen lock then works as expected, the unlock screen is presented, user unlocks, NFC tags work.

Anyone have any ideas on what is going on and how I can either make it lock properly each time or replicate what is happening with the home button somehow?

The kiosk policy:

  policy_json = '''
{
  "kioskCustomization": 
  {
    "statusBar": "SYSTEM_INFO_ONLY",
    "deviceSettings": "SETTINGS_ACCESS_ALLOWED",
    "systemErrorWarnings": "ERROR_AND_WARNINGS_ENABLED"
  },

  "advancedSecurityOverrides":
  {
    "googlePlayProtectVerifyApps": "VERIFY_APPS_USER_CHOICE",
    "developerSettings": "DEVELOPER_SETTINGS_ALLOWED"
  },
  
  "keyguardDisabled": false,
  
  "keyguardDisabledFeatures": [
    "ALL_FEATURES"
  ],

  "maximumTimeToLock": 0,
  "bluetoothConfigDisabled": true,
  "wifiConfigsLockdownEnabled" : true,
  "cameraDisabled" : true,

    "applications": 
  [          
    {
      
      "installType": "KIOSK",
      "defaultPermissionPolicy": "GRANT",
      
      "autoUpdateMode": "AUTO_UPDATE_HIGH_PRIORITY" 
    }
  ],

  "kioskCustomization":
  {
    "powerButtonActions": "POWER_BUTTON_AVAILABLE",
    "systemErrorWarnings": "ERROR_AND_WARNINGS_ENABLED",
    "systemNavigation": "HOME_BUTTON_ONLY",
    "statusBar": "NOTIFICATIONS_AND_SYSTEM_INFO_ENABLED",
    "deviceSettings": "SETTINGS_ACCESS_ALLOWED"
  },

  

  "debuggingFeaturesAllowed": true  
}
0 Answers
Related