DPM and DPMS changes to support DO on AAOS
Allows setup from non-system user.
Sets up DO on system user regardless of callingUid.
Adds TODOs for refactoring split system user legacy codes.
Bug: 171336247
Test: manual
1. Enable the feature:
adb push frameworks/native/data/etc/android.software.device_admin.xml
2. Factory reset the device OR
2a. Set device to unprovisioned
adb shell settings put global device_provisioned 0 && adb shell rm /data/system/device_owner_2.xml /data/system/device_policies.xml
2b. Remove users' device policy setting
adb shell rm /data/system/users/10/device_policies.xml && adb shell rm /data/system/users/0/device_policies.xml && adb shell settings put secure --user 10 user_setup_complete 0 && adb shell settings put secure --user 0 user_setup_complete 0
3. Cherry-pick change (Change-Id: I8e11eb5fcb0a453e702dd8863b74ea193b4d59f3) for TestDPC and install
4. Launch setup flow
adb shell am start com.afwsamples.testdpc/com.afwsamples.testdpc.SetupManagementLaunchActivity
5. verify
adb shell dumpsys activity service com.afwsamples.testdpc create-user
Change-Id: I86bb6284b87a06b1f04b0f8bd307da2d27121136
2 files changed