Skip to content

Commit

Permalink
[kiosksetup] Fix lock task not available on some devices.
Browse files Browse the repository at this point in the history
Apparently not all devices send ACTION_DEVICE_OWNER_CHANGED when
provisioning via QR code. Handle DeviceAdminReceiver.onEnabled and setup
the lock task packages as well as preferred activity in response to
both.
  • Loading branch information
msimonides committed May 30, 2024
1 parent 657e104 commit 90b2e02
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ class DeviceAdminReceiver : android.app.admin.DeviceAdminReceiver(), KoinCompone

private val deviceAdmin: DeviceAdmin by inject()

override fun onEnabled(context: Context, intent: Intent) {
super.onEnabled(context, intent)
deviceAdmin.onDeviceOwnerChanged()
}

override fun onDisabled(context: Context, intent: Intent) {
deviceAdmin.onBeforeDisabled()
super.onDisabled(context, intent)
Expand Down

0 comments on commit 90b2e02

Please sign in to comment.