JoykooSmartApp/app/src/main/java/mx/joykoo/scanner/KioskAdminReceiver.kt
caspar 455f8498f7
All checks were successful
APK-BUILD/pipeline/head This commit looks good
Add kiosk lockdown, custom status strip, crash recovery and error screens
- Kiosk mode: scanning AppConfig.KIOSK_BARCODE toggles Android Lock Task
  mode (persisted). As device owner (KioskAdminReceiver) it is a full
  lockdown and the app becomes the persistent home screen; otherwise it
  falls back to screen pinning. "Salir" and Back-to-exit are disabled
  while kiosk mode is on.
- Status strip: app-drawn bar showing only Wi-Fi status and battery
  percentage; system bars stay hidden.
- Renderer crash: onRenderProcessGone replaces the WebView and reloads
  the last URL; repeated crashes show an error screen instead.
- Error screen: per-cause messages (no Wi-Fi with auto-retry on
  reconnect, server unreachable, 5xx, SSL) and an "Ir al inicio"
  button; 4xx pages are left to the site.
- Mixed content is never allowed.
- Admin volume-key hold reduced to 3 seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:37:25 -04:00

12 lines
363 B
Kotlin

package mx.joykoo.scanner
import android.app.admin.DeviceAdminReceiver
/**
* Device admin component. Making the app device owner lets KioskController use
* full Lock Task mode (no Home/Recents, no notification shade, no prompt):
*
* adb shell dpm set-device-owner mx.joykoo.scanner/.KioskAdminReceiver
*/
class KioskAdminReceiver : DeviceAdminReceiver()