Loading core/java/android/app/admin/flags/flags.aconfig +10 −0 Original line number Original line Diff line number Diff line Loading @@ -43,6 +43,16 @@ flag { bug: "295324350" bug: "295324350" } } flag { name: "hsum_unlock_notification_fix" namespace: "enterprise" description: "Using the right userId when starting the work profile unlock flow " bug: "327350831" metadata { purpose: PURPOSE_BUGFIX } } flag { flag { name: "dumpsys_policy_engine_migration_enabled" name: "dumpsys_policy_engine_migration_enabled" namespace: "enterprise" namespace: "enterprise" Loading services/core/java/com/android/server/locksettings/LockSettingsService.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -724,12 +724,13 @@ public class LockSettingsService extends ILockSettings.Stub { !mUserManager.isQuietModeEnabled(userHandle)) { !mUserManager.isQuietModeEnabled(userHandle)) { // Only show notifications for managed profiles once their parent // Only show notifications for managed profiles once their parent // user is unlocked. // user is unlocked. showEncryptionNotificationForProfile(userHandle, reason); showEncryptionNotificationForProfile(userHandle, parent.getUserHandle(), reason); } } } } } } private void showEncryptionNotificationForProfile(UserHandle user, String reason) { private void showEncryptionNotificationForProfile(UserHandle user, UserHandle parent, String reason) { CharSequence title = getEncryptionNotificationTitle(); CharSequence title = getEncryptionNotificationTitle(); CharSequence message = getEncryptionNotificationMessage(); CharSequence message = getEncryptionNotificationMessage(); CharSequence detail = getEncryptionNotificationDetail(); CharSequence detail = getEncryptionNotificationDetail(); Loading @@ -746,8 +747,15 @@ public class LockSettingsService extends ILockSettings.Stub { unlockIntent.setFlags( unlockIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); PendingIntent intent = PendingIntent.getActivity(mContext, 0, unlockIntent, PendingIntent intent; if (android.app.admin.flags.Flags.hsumUnlockNotificationFix()) { intent = PendingIntent.getActivityAsUser(mContext, 0, unlockIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED, null, parent); } else { intent = PendingIntent.getActivity(mContext, 0, unlockIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED); } Slogf.d(TAG, "Showing encryption notification for user %d; reason: %s", Slogf.d(TAG, "Showing encryption notification for user %d; reason: %s", user.getIdentifier(), reason); user.getIdentifier(), reason); Loading Loading
core/java/android/app/admin/flags/flags.aconfig +10 −0 Original line number Original line Diff line number Diff line Loading @@ -43,6 +43,16 @@ flag { bug: "295324350" bug: "295324350" } } flag { name: "hsum_unlock_notification_fix" namespace: "enterprise" description: "Using the right userId when starting the work profile unlock flow " bug: "327350831" metadata { purpose: PURPOSE_BUGFIX } } flag { flag { name: "dumpsys_policy_engine_migration_enabled" name: "dumpsys_policy_engine_migration_enabled" namespace: "enterprise" namespace: "enterprise" Loading
services/core/java/com/android/server/locksettings/LockSettingsService.java +12 −4 Original line number Original line Diff line number Diff line Loading @@ -724,12 +724,13 @@ public class LockSettingsService extends ILockSettings.Stub { !mUserManager.isQuietModeEnabled(userHandle)) { !mUserManager.isQuietModeEnabled(userHandle)) { // Only show notifications for managed profiles once their parent // Only show notifications for managed profiles once their parent // user is unlocked. // user is unlocked. showEncryptionNotificationForProfile(userHandle, reason); showEncryptionNotificationForProfile(userHandle, parent.getUserHandle(), reason); } } } } } } private void showEncryptionNotificationForProfile(UserHandle user, String reason) { private void showEncryptionNotificationForProfile(UserHandle user, UserHandle parent, String reason) { CharSequence title = getEncryptionNotificationTitle(); CharSequence title = getEncryptionNotificationTitle(); CharSequence message = getEncryptionNotificationMessage(); CharSequence message = getEncryptionNotificationMessage(); CharSequence detail = getEncryptionNotificationDetail(); CharSequence detail = getEncryptionNotificationDetail(); Loading @@ -746,8 +747,15 @@ public class LockSettingsService extends ILockSettings.Stub { unlockIntent.setFlags( unlockIntent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); PendingIntent intent = PendingIntent.getActivity(mContext, 0, unlockIntent, PendingIntent intent; if (android.app.admin.flags.Flags.hsumUnlockNotificationFix()) { intent = PendingIntent.getActivityAsUser(mContext, 0, unlockIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED, null, parent); } else { intent = PendingIntent.getActivity(mContext, 0, unlockIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED); } Slogf.d(TAG, "Showing encryption notification for user %d; reason: %s", Slogf.d(TAG, "Showing encryption notification for user %d; reason: %s", user.getIdentifier(), reason); user.getIdentifier(), reason); Loading