Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -1095,13 +1095,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { // (ACTION_DATE_CHANGED), or when manual clock adjustment is made // (ACTION_DATE_CHANGED), or when manual clock adjustment is made // (ACTION_TIME_CHANGED) // (ACTION_TIME_CHANGED) updateSystemUpdateFreezePeriodsRecord(/* saveIfChanged */ true); updateSystemUpdateFreezePeriodsRecord(/* saveIfChanged */ true); final int userId = getManagedUserId(mUserManager.getMainUser().getIdentifier()); final int userId = getManagedUserId(getMainUserId()); if (userId >= 0) { if (userId >= 0) { updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); } } } else if (ACTION_PROFILE_OFF_DEADLINE.equals(action)) { } else if (ACTION_PROFILE_OFF_DEADLINE.equals(action)) { Slogf.i(LOG_TAG, "Profile off deadline alarm was triggered"); Slogf.i(LOG_TAG, "Profile off deadline alarm was triggered"); final int userId = getManagedUserId(mUserManager.getMainUser().getIdentifier()); final int userId = getManagedUserId(getMainUserId()); if (userId >= 0) { if (userId >= 0) { updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); } else { } else { Loading Loading @@ -8879,6 +8879,15 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } } } private @UserIdInt int getMainUserId() { UserHandle mainUser = mUserManager.getMainUser(); if (mainUser == null) { Slogf.d(LOG_TAG, "getMainUserId(): no main user, returning USER_SYSTEM"); return UserHandle.USER_SYSTEM; } return mainUser.getIdentifier(); } // TODO(b/240562946): Remove api as owner name is not used. // TODO(b/240562946): Remove api as owner name is not used. /** /** * Returns the "name" of the device owner. It'll work for non-DO users too, but requires * Returns the "name" of the device owner. It'll work for non-DO users too, but requires Loading Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -1095,13 +1095,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { // (ACTION_DATE_CHANGED), or when manual clock adjustment is made // (ACTION_DATE_CHANGED), or when manual clock adjustment is made // (ACTION_TIME_CHANGED) // (ACTION_TIME_CHANGED) updateSystemUpdateFreezePeriodsRecord(/* saveIfChanged */ true); updateSystemUpdateFreezePeriodsRecord(/* saveIfChanged */ true); final int userId = getManagedUserId(mUserManager.getMainUser().getIdentifier()); final int userId = getManagedUserId(getMainUserId()); if (userId >= 0) { if (userId >= 0) { updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); } } } else if (ACTION_PROFILE_OFF_DEADLINE.equals(action)) { } else if (ACTION_PROFILE_OFF_DEADLINE.equals(action)) { Slogf.i(LOG_TAG, "Profile off deadline alarm was triggered"); Slogf.i(LOG_TAG, "Profile off deadline alarm was triggered"); final int userId = getManagedUserId(mUserManager.getMainUser().getIdentifier()); final int userId = getManagedUserId(getMainUserId()); if (userId >= 0) { if (userId >= 0) { updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); updatePersonalAppsSuspension(userId, mUserManager.isUserUnlocked(userId)); } else { } else { Loading Loading @@ -8879,6 +8879,15 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } } } } private @UserIdInt int getMainUserId() { UserHandle mainUser = mUserManager.getMainUser(); if (mainUser == null) { Slogf.d(LOG_TAG, "getMainUserId(): no main user, returning USER_SYSTEM"); return UserHandle.USER_SYSTEM; } return mainUser.getIdentifier(); } // TODO(b/240562946): Remove api as owner name is not used. // TODO(b/240562946): Remove api as owner name is not used. /** /** * Returns the "name" of the device owner. It'll work for non-DO users too, but requires * Returns the "name" of the device owner. It'll work for non-DO users too, but requires Loading