Reference
Kiosk provisioning
Locks a fleet tablet to the cockpit so a passenger cannot leave the app, the lockscreen advertisements never appear, and the tablet cannot reboot into an OS update mid-event — and, because the cockpit is set as the device's Home app, it relaunches itself after a reboot or power loss.
Why device owner, and why a factory reset
| Escapable? | Survives reboot? | Kills lockscreen? | Needs reset? | |
|---|---|---|---|---|
| Screen pinning | Yes, back + recents | No | No | No |
| Lock task as device owner | No | Yes | Yes | Yes |
Screen pinning tells the user how to leave. That is fine for a demo and useless for a tablet strangers will poke all week.
Device owner can only be set on a device with no accounts configured, which in
practice means straight after a factory reset. That is the entire reason the reset is needed —
it is not superstition, the dpm command refuses otherwise.
Steps, per tablet
- Factory reset. Settings → General management → Reset → Factory data reset.
- Skip account sign-in during setup. This is the step that matters. If an Amazon or
Google account gets added,
dpmwill refuse and you have to reset again. Skip Wi-Fi too if it pushes you toward signing in; add it afterwards. - Enable developer options and ADB (Settings → About tablet/phone → Software information → tap Build number ×7, then Developer options → USB debugging).
- Install and provision:
Success printsadb install -r app-debug.apk adb shell dpm set-device-owner \ org.pureagave.zodiac.control/.kiosk.ZodiacDeviceAdminReceiverActive admin set to component {...}. - Launch the app. It locks itself on resume.
A device-owner app cannot be uninstalled and can only be updated by an APK signed with
the same key, so a tablet provisioned with one laptop's debug keystore can never be
moved to a release build (or any other machine's debug build) without a factory reset. Use a
release APK from a stable, backed-up keystore for anything that stays in the fleet;
app-debug.apk is fine only for a throwaway test tablet.
Runtime permissions are pre-granted
A device owner does not auto-grant runtime permissions, and once
engage() disables the status bar and enters lock task there is no way for anyone to reach
Settings to grant one that is missing. So engage() pre-grants the app's own requested set
(requiredCockpitPermissions): ACCESS_FINE_LOCATION always, plus
BLUETOOTH_CONNECT / BLUETOOTH_SCAN on API 31+ (the Samsungs). It grants
nothing beyond what the manifest already declares and the app already asks for.
Auto-relaunch after a reboot
A kiosked tablet relaunches the cockpit by itself after a reboot or power loss
— the failure the fleet can least afford is a mounted display sitting on the stock (ad) launcher
until someone finds and taps the app. Android blocks a BOOT_COMPLETED receiver from
starting an activity in the background, but it always launches Home at boot, so engage()
makes the cockpit the device's Home app (a persistent preferred Home, so no chooser
appears), and the cockpit's onResume() then re-enters lock task. Keyguard is already
disabled, so nothing stands between power-on and the cockpit.
It is an <activity-alias> (KioskHomeActivity) that
engage() enables and the exit code disables again — so a non-provisioned device
is never offered as a launcher, exactly like every other kiosk policy here being a no-op without
device owner. Device-owner-only, so it cannot be exercised in CI; verify it by rebooting a
provisioned tablet.
Verify
adb shell dumpsys device_policy | grep -i "device owner"
adb logcat -d | grep "kiosk:" # "kiosk: locked to org.pureagave..."
adb logcat -d | grep "kiosk: pre-granted" # lists ACCESS_FINE_LOCATION (+ Bluetooth on a Samsung)
Verify auto-relaunch — the whole point of the Home step. After provisioning,
adb reboot and confirm the cockpit comes back on its own with no tap (a Samsung delivers
Home a couple of minutes after boot — be patient):
adb reboot
adb shell dumpsys window | grep -i mCurrentFocus # -> org.pureagave.zodiac.control/.MainActivity
adb logcat -d | grep "kiosk: set as preferred Home"
mCurrentFocus on the cockpit (not the stock launcher) after a cold boot is the pass.
This is the one check CI can never do — do it on a test tablet before trusting the fleet to
recover unattended.
Getting back out
There is no adb un-provision on the shipped build:
dpm remove-active-admin throws SecurityException (it only works on a
testOnly APK, which the fleet is not), and a device-owner app cannot be uninstalled. So
there are exactly two ways out:
- The hidden exit code — primary, no reset. On the running cockpit, tap the
two hidden right-edge corners — bottom-right, then top-right, alternating, six taps
total — each within 2 s of the last. The app un-provisions itself: it leaves lock
task, gives Home back to the stock launcher (clears the persistent preferred Home and disables the
KioskHomeActivityalias), and relinquishes device owner, so the tablet is unlocked and can be serviced, updated or uninstalled. - Factory reset — fallback. If the app is wedged and will not take the code, a reset is the only other way; it wipes the tablet and you re-provision from step 1.
The device-owner path cannot be exercised in CI, so an on-device dry-run is the only real check:
provision one, enter the code, confirm dumpsys device_policy shows no device owner.
Provision the fleet only once the build is settled.
Fire tablets cannot be kiosked
Established by exhausting every option on a 9th-gen KFMAWI (API 28) and an 11th-gen
KFTUWI (API 30). Fire OS ships com.amazon.parentalcontrols as a
profile owner baked into the OS image, and a profile owner blocks
dpm set-device-owner outright. It is unremovable without root: it survives a factory
reset and an online deregister, dpm remove-active-admin throws
SecurityException: non-test admin, and pm uninstall --user 0 fails with
DELETE_FAILED_INTERNAL_ERROR.
The Samsungs (S9+, A54) have no profile owner and provision cleanly. So the passenger Fires get neither the kiosk nor the auto-relaunch after reboot. The options for them: run unlocked (accept the ad lockscreen and a manual tap after each power-cycle), lighter screen-pinning (escapable, no auto-relaunch), or swap the passenger displays for non-Fire Android tablets.
Which tablets should get it
| Device | Kiosk? | Why |
|---|---|---|
| S9+ hero dashboard | Yes | Samsung, provisions cleanly; mounted, worth it |
| A54 driver phone | Probably not | Kiosk means no maps, no phone, no camera on that device — a lot to give up on the one screen the driver might genuinely need something else from |
| Passenger Fires | Cannot | Fire OS's built-in profile owner blocks dpm set-device-owner (above). Run unlocked or use screen-pinning |
| XCover beacon | No | It is headless already; kiosk buys nothing |
Gotchas
ZodiacDeviceAdminReceiver or the KioskHomeActivity alias
Renaming or deleting ZodiacDeviceAdminReceiver breaks provisioning on every
already-provisioned tablet, and the only fix is another factory reset. The class is intentionally
empty so there is never a reason to touch it. The same caveat applies to the
KioskHomeActivity <activity-alias>: KioskController
references it by string, so a rename breaks auto-relaunch on already-provisioned tablets
silently — the manifest name and the string must stay in lockstep.
- The signing trap (provisioning with a per-machine debug APK) is now documented above.
- The escape hatch is the hidden six-tap exit code, shipped and verified in the 2026-08-13 audit fix.
- Automatic OS updates are disabled through
setSystemUpdatePolicyrather than theota_disable_automatic_updatekey that API 34 rejects.
Converted fromdocs/KIOSK.md