📚 Encyclopedia

Android · updated 2026-10-13

Locking down an Android phone with a device-owner app

androiddevice-ownerdpmparental-controlskiosklockdowncall-screening

A device owner is an app with full Device Policy Manager authority, normally set by an MDM at provisioning. Setting your own app as device owner over adb turns a spare phone into a managed device with no Google services. This was used to build a locked-down phone for a 12-year-old (Pixel 2 XL on LineageOS 22.2, guardian app com.phone.guardian, the Message SMS app providing the texting allowlist).

Becoming device owner

Restrictions that matter

User restrictions applied by the owner: DISALLOW_INSTALL_APPS, DISALLOW_INSTALL_UNKNOWN_SOURCES, DISALLOW_CONFIG_PRIVATE_DNS, DISALLOW_FACTORY_RESET, DISALLOW_SAFE_BOOT, DISALLOW_ADD_USER, DISALLOW_USB_FILE_TRANSFER, and the one first forgotten: - DISALLOW_APPS_CONTROL: without it the user can go to Settings > Apps > Clear data on the messaging app, wiping its parent PIN and allowlist. - DISALLOW_DEBUGGING_FEATURES kills adb, so apply it last, only after everything else is verified. Expose it as an exported broadcast receiver that can only add the restriction (adb shell am broadcast -a <pkg>.APPLY_DEBUG_LOCKDOWN), and keep a "lift lockdown" path in the parent UI. After that, the app's own update channel is the only management path.

Other owner powers used: - Private DNS forced to a family filter (family-filter-dns.cleanbrowsing.org, which also forces YouTube Restricted Mode). - Force a default browser with addPersistentPreferredActivity (cleared on lift). - Silent app installs from a parent-uploaded APK via PackageInstaller (device owners need no user confirmation). The app reads package and versionCode from the downloaded file (getPackageArchiveInfo) so the server need not parse APKs, and reports install status back. The installer never uninstalls itself and reports status before installing its own update, since the process dies on success. - Disable stock apps with pm disable-user --user 0 <pkg> (for example the built-in browser).

Calls and texts

Remote management design

Server is the single source of truth; both apps pull it (on boot, hourly via WorkManager, and on a manual "Sync now"), replace their lists wholesale, and keep the last good config on any failure. Hourly polling exists so a parent's removals land without the child's cooperation. A device token is provisioned once into both apps (typing a 64-hex token with adb shell input text works well). See Doze, WorkManager backoff, and background sync that stalls for why hourly sync stalled.

Accepted limits

See also

Linked from

Sources: phone memory (kid-phone-project, guardian-remote-management), message memory (project_kid_mode)