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

Commit 422e2418 authored by Yan Zhu's avatar Yan Zhu
Browse files

Fix set-device-owner from shell for AAOS

Do not clear calling identify when setting DO for AAOS

Test: manual: download and install TestDPC
adb shell dpm set-device-owner --user 0 com.afwsamples.testdpc/.DeviceAdminReceiver
Fix: 176107119

Change-Id: I4b3b49c8fadc57088ecf506e1e31caff1f7118c7
parent 2f1cedb3
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -7620,10 +7620,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                        + " as profile owner on user " + currentForegroundUser);
                // Sets profile owner on current foreground user since
                // the human user will complete the DO setup workflow from there.
                mInjector.binderWithCleanCallingIdentity(() ->
                manageUserUnchecked(/* deviceOwner= */ admin, /* profileOwner= */ admin,
                            /* managedUser= */ currentForegroundUser,
                                /* adminExtras= */ null));
                            /* adminExtras= */ null);
            }
            return true;
        }