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

Commit 890ff6c5 authored by Yan Zhu's avatar Yan Zhu Committed by Android (Google) Code Review
Browse files

Merge "Improve DevicePolicyManagerTest for secondary user"

parents f6a2b87e ce9ec7f7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -8378,7 +8378,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    @Override
    public boolean hasUserSetupCompleted() {
        return hasUserSetupCompleted(UserHandle.getCallingUserId());
        return hasUserSetupCompleted(mInjector.userHandleGetCallingUserId());
    }
    // This checks only if the Setup Wizard has run.  Since Wear devices pair before
@@ -15303,7 +15303,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    private List<ActiveAdmin> getProfileOwnerAdminsForCurrentProfileGroup() {
        synchronized (getLockObject()) {
            final List<ActiveAdmin> admins = new ArrayList<>();
            int[] users = mUserManager.getProfileIdsWithDisabled(UserHandle.getCallingUserId());
            int[] users = mUserManager.getProfileIdsWithDisabled(
                    mInjector.userHandleGetCallingUserId());
            for (int i = 0; i < users.length; i++) {
                final ComponentName componentName = getProfileOwnerAsUser(users[i]);
                if (componentName != null) {
+2 −2
Original line number Diff line number Diff line
@@ -352,8 +352,8 @@ public class DevicePolicyManagerServiceTestable extends DevicePolicyManagerServi
        }

        @Override
        boolean userManagerIsSplitSystemUser() {
            return services.userManagerForMock.isSplitSystemUser();
        boolean userManagerIsHeadlessSystemUserMode() {
            return services.userManagerForMock.isHeadlessSystemUserMode();
        }

        @Override
+163 −298

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -421,7 +421,7 @@ public class MockSystemServices {
    }

    public static class UserManagerForMock {
        public boolean isSplitSystemUser() {
        public boolean isHeadlessSystemUserMode() {
            return false;
        }
    }