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

Commit acd2cba0 authored by Ivan Podogov's avatar Ivan Podogov Committed by Garvit Narang
Browse files

Allow setting Device Owner after pairing

Note: it will still only be possible to set DO before SetupWizard finishes.
If you skip setup using TEST_MODE, setting DO will still be blocked.

Bug: 176797754
Test: provision with cdpc
Change-Id: Iab9f52680c83d0704de4f404f3fe57a2fa1e3e4c
(cherry picked from commit ef88454d8ed02b1198dcc348addbde815485f3d5)
(cherry picked from commit 5cf188c31137febaea87b0ab77d14389d833e9d7)
parent 9accafa7
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -16520,9 +16520,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        if (!mUserManager.isUserRunning(new UserHandle(deviceOwnerUserId))) {
            return STATUS_USER_NOT_RUNNING;
        }
        if (mIsWatch && hasPaired(UserHandle.USER_SYSTEM)) {
            return STATUS_HAS_PAIRED;
        }
        boolean isHeadlessSystemUserMode = mInjector.userManagerIsHeadlessSystemUserMode();
@@ -16546,7 +16543,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        if (isAdb) {
            // If shell command runs after user setup completed check device status. Otherwise, OK.
            if (mIsWatch || hasUserSetupCompleted(UserHandle.USER_SYSTEM)) {
            if (hasUserSetupCompleted(UserHandle.USER_SYSTEM)) {
                // DO can be setup only if there are no users which are neither created by default
                // nor marked as FOR_TESTING