Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5cbbac84 authored by Yan Zhu's avatar Yan Zhu
Browse files

Improve headless system user's DO setup flow

1. Change manageUser to be setup on current user
2. add pre condition check for headless system user mode: disallows setup when current user is system user 0 and only allows device owner to be set on user 0
3. Changes method name and adds param names

To verify:
1. Install TestDPC app: https://github.com/googlesamples/android-testdpc
2. make sure device is unprovisioned
adb shell dumpsys device_policy
2'. deprovion if needed
adb shell settings put global device_provisioned 0 && adb shell rm /data/system/device_owner_2.xml /data/system/device_policies.xml
3. make sure deivce_amdmin feature is available
 adb shell pm list features | grep "admin"
3'. install feature if needed
adb push frameworks/native/data/etc/android.software.device_admin.xml
/vendor/etc/permissions/
4. run
adb shell dpm set-device-owner --user 0 com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver
5. verify with
adb shell dumpsys device_policy
6. try to set on user 10 will fail
adb shell dpm set-device-owner --user 10 com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver
6. switch to user 0, repeat 4. It shall fail.

Bug: 170333009
Bug: 174610623
Test: manual with steps above
Change-Id: Iaa46032fa6487d792f7bde5de5ff6e55b9c36432
parent f010d5de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment