googlesamples / googlesamples/android-testdpc

DeviceAdminService does not restart after reboot

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1k
Forks
422
PR merge metrics
No merged PRs in 30d

Description

When I set a device owner it will behave correctly (including automatically launching the DeviceAdminService when the owner is set) until a restart, where the DeviceAdminService will not launch but the package will remain as device owner.
It was my understanding that the DeviceAdminService should be started on boot by the system. This was working recently until I updated to Android 13 (though I am unable to confirm if this is the cause).

Repro steps:
1. Starts with clean device that has no device owner registered
2. Install Test DPC
3. Set Test DPC as device owner with adb command: `adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver`
4. Check running services with command: `adb shell dumpsys activity services`. DeviceAdminService will be listed as running.
5. Restart the device
6. Run the same adb shell dumpsys activity services command. The service will not be listed as running despite being the DeviceAdminService

Is this behaviour correct? Is there any way to manually start the DeviceAdminService on boot?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.