OSDN Git Service

resolve merge conflicts of c874e60 to master
authorGreg Plesur <plesur@google.com>
Fri, 4 Nov 2016 16:34:30 +0000 (12:34 -0400)
committerGreg Plesur <plesur@google.com>
Fri, 4 Nov 2016 16:34:30 +0000 (12:34 -0400)
Change-Id: I39381c516e4a1267d06e3f7b682d1cf73eeb6f9b

1  2 
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java

@@@ -6409,8 -6389,9 +6412,8 @@@ public class DevicePolicyManagerServic
              throw new IllegalStateException("Trying to set the profile owner, but the user "
                      + "already has a device owner.");
          }
 -        int callingUid = mInjector.binderGetCallingUid();
 -        if (callingUid == Process.SHELL_UID || callingUid == Process.ROOT_UID) {
 +        if (isAdb()) {
-             if (hasUserSetupCompleted(userHandle)
+             if ((mIsWatch || hasUserSetupCompleted(userHandle))
                      && hasIncompatibleAccountsLocked(userHandle, owner)) {
                  throw new IllegalStateException("Not allowed to set the profile owner because "
                          + "there are already some accounts on the profile");