Loading core/java/android/app/notification.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -157,13 +157,6 @@ flag { bug: "342602960" } flag { name: "redact_sensitive_content_notifications_on_lockscreen" namespace: "systemui" description: "redacts notifications on the lockscreen if they have the 'sensitiveContent' flag" bug: "343631648" } flag { name: "backup_restore_logging" namespace: "systemui" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +1 −27 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.LauncherProxyService; import com.android.systemui.flags.SceneContainerFlagParameterizationKt; import com.android.systemui.SysuiTestCase; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor; Loading @@ -82,6 +81,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.DisableSceneContainer; import com.android.systemui.flags.EnableSceneContainer; import com.android.systemui.flags.FakeFeatureFlagsClassic; import com.android.systemui.flags.SceneContainerFlagParameterizationKt; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.UserTracker; Loading @@ -90,7 +90,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel; import com.android.systemui.statusbar.policy.DeviceProvisionedController; Loading Loading @@ -550,7 +549,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfNotLocked() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -571,7 +569,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfUnlockedSinceReceipt() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -591,7 +588,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfNotLockedForLongEnough() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -611,7 +607,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfOnWifi() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -632,7 +627,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfConnectedToWifiSinceReceiving() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -653,25 +647,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @DisableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfFlagDisabled() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, mCurrentUser.id); changeSetting(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS); // Claim the device was last locked 1 day ago mLockscreenUserManager.mLastLockTime .set(mSensitiveNotifPostTime - TimeUnit.DAYS.toMillis(1)); mLockscreenUserManager.mLocked.set(true); mLockscreenUserManager.mConnectedToWifi.set(false); // Sensitive Content notifications are always redacted assertEquals(REDACTION_TYPE_NONE, mLockscreenUserManager.getRedactionType(mSensitiveContentNotif)); } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testNewSensitiveNotification_notRedactedIfOldCreationTime() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -688,7 +663,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_redacted() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinderImplTest.kt +0 −4 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ import com.android.systemui.statusbar.notification.row.NotificationRowContentBin import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag import com.android.systemui.statusbar.notification.row.NotificationRowContentBinderImpl.InflationTaskTracker import com.android.systemui.statusbar.notification.row.shared.HeadsUpStatusBarModel import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction import com.android.systemui.statusbar.notification.row.shared.NewRemoteViews import com.android.systemui.statusbar.notification.row.shared.NotificationContentModel import com.android.systemui.statusbar.policy.InflatedSmartReplyState Loading Loading @@ -87,7 +86,6 @@ import platform.test.runner.parameterized.Parameters @SmallTest @RunWith(ParameterizedAndroidJunit4::class) @RunWithLooper @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : SysuiTestCase() { init { Loading Loading @@ -514,7 +512,6 @@ class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : Sysui @Test @Throws(java.lang.Exception::class) @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) fun testSensitiveContentPublicView_messageStyle() { val displayName = "Display Name" val messageText = "Message Text" Loading Loading @@ -557,7 +554,6 @@ class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : Sysui @Test @Throws(java.lang.Exception::class) @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) fun testSensitiveContentPublicView_nonMessageStyle() { val contentTitle = "Content Title" val contentText = "Content Text" Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading Loading @@ -376,7 +375,7 @@ public class NotificationLockscreenUserManagerImpl implements // To avoid dependency injection cycle, finish constructing this object before using the // KeyguardInteractor. The CoroutineScope will only be null in tests. if (LockscreenOtpRedaction.isEnabled() && coroutineScope != null) { if (coroutineScope != null) { mMainExecutor.execute(() -> { JavaAdapterKt.collectFlow(coroutineScope, keyguardInteractor.get().isKeyguardDismissible(), Loading Loading @@ -774,10 +773,6 @@ public class NotificationLockscreenUserManagerImpl implements * This version of the method logs a metric about the request. */ private boolean shouldShowSensitiveContentRedactedView(NotificationEntry ent) { if (!LockscreenOtpRedaction.isEnabled()) { return false; } if (ent.getRanking() == null || !ent.getRanking().hasSensitiveContent()) { return false; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +2 −9 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ import com.android.systemui.statusbar.notification.row.RowInflaterTask; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; import com.android.systemui.statusbar.notification.row.shared.AsyncGroupHeaderViewInflation; import com.android.systemui.statusbar.notification.row.shared.AsyncHybridViewInflation; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import javax.inject.Inject; Loading Loading @@ -184,10 +183,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC); if (AsyncHybridViewInflation.isEnabled()) { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_SINGLE_LINE); if (LockscreenOtpRedaction.isSingleLineViewEnabled()) { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); } } mRowContentBindStage.requestRebind(entry, null); } Loading Loading @@ -271,11 +268,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { // when the group status changes params.markContentViewsFreeable(FLAG_CONTENT_VIEW_SINGLE_LINE); } } if (LockscreenOtpRedaction.isSingleLineViewEnabled()) { if (inflaterParams.isChildInGroup() && redactionType != REDACTION_TYPE_NONE) { if (inflaterParams.isChildInGroup() && redactionType != REDACTION_TYPE_NONE) { params.requireContentViews(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); } else { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); Loading Loading
core/java/android/app/notification.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -157,13 +157,6 @@ flag { bug: "342602960" } flag { name: "redact_sensitive_content_notifications_on_lockscreen" namespace: "systemui" description: "redacts notifications on the lockscreen if they have the 'sensitiveContent' flag" bug: "343631648" } flag { name: "backup_restore_logging" namespace: "systemui" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +1 −27 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ import androidx.test.filters.SmallTest; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.LauncherProxyService; import com.android.systemui.flags.SceneContainerFlagParameterizationKt; import com.android.systemui.SysuiTestCase; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor; Loading @@ -82,6 +81,7 @@ import com.android.systemui.dump.DumpManager; import com.android.systemui.flags.DisableSceneContainer; import com.android.systemui.flags.EnableSceneContainer; import com.android.systemui.flags.FakeFeatureFlagsClassic; import com.android.systemui.flags.SceneContainerFlagParameterizationKt; import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.settings.UserTracker; Loading @@ -90,7 +90,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel; import com.android.systemui.statusbar.policy.DeviceProvisionedController; Loading Loading @@ -550,7 +549,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfNotLocked() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -571,7 +569,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfUnlockedSinceReceipt() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -591,7 +588,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfNotLockedForLongEnough() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -611,7 +607,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfOnWifi() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -632,7 +627,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfConnectedToWifiSinceReceiving() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -653,25 +647,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @DisableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_notRedactedIfFlagDisabled() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, mCurrentUser.id); changeSetting(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS); // Claim the device was last locked 1 day ago mLockscreenUserManager.mLastLockTime .set(mSensitiveNotifPostTime - TimeUnit.DAYS.toMillis(1)); mLockscreenUserManager.mLocked.set(true); mLockscreenUserManager.mConnectedToWifi.set(false); // Sensitive Content notifications are always redacted assertEquals(REDACTION_TYPE_NONE, mLockscreenUserManager.getRedactionType(mSensitiveContentNotif)); } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testNewSensitiveNotification_notRedactedIfOldCreationTime() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading @@ -688,7 +663,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { } @Test @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) public void testHasSensitiveContent_redacted() { // Allow private notifications for this user mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinderImplTest.kt +0 −4 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ import com.android.systemui.statusbar.notification.row.NotificationRowContentBin import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.InflationFlag import com.android.systemui.statusbar.notification.row.NotificationRowContentBinderImpl.InflationTaskTracker import com.android.systemui.statusbar.notification.row.shared.HeadsUpStatusBarModel import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction import com.android.systemui.statusbar.notification.row.shared.NewRemoteViews import com.android.systemui.statusbar.notification.row.shared.NotificationContentModel import com.android.systemui.statusbar.policy.InflatedSmartReplyState Loading Loading @@ -87,7 +86,6 @@ import platform.test.runner.parameterized.Parameters @SmallTest @RunWith(ParameterizedAndroidJunit4::class) @RunWithLooper @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : SysuiTestCase() { init { Loading Loading @@ -514,7 +512,6 @@ class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : Sysui @Test @Throws(java.lang.Exception::class) @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) fun testSensitiveContentPublicView_messageStyle() { val displayName = "Display Name" val messageText = "Message Text" Loading Loading @@ -557,7 +554,6 @@ class NotificationRowContentBinderImplTest(flags: FlagsParameterization) : Sysui @Test @Throws(java.lang.Exception::class) @EnableFlags(LockscreenOtpRedaction.FLAG_NAME) fun testSensitiveContentPublicView_nonMessageStyle() { val contentTitle = "Content Title" val contentText = "Content Text" Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading Loading @@ -376,7 +375,7 @@ public class NotificationLockscreenUserManagerImpl implements // To avoid dependency injection cycle, finish constructing this object before using the // KeyguardInteractor. The CoroutineScope will only be null in tests. if (LockscreenOtpRedaction.isEnabled() && coroutineScope != null) { if (coroutineScope != null) { mMainExecutor.execute(() -> { JavaAdapterKt.collectFlow(coroutineScope, keyguardInteractor.get().isKeyguardDismissible(), Loading Loading @@ -774,10 +773,6 @@ public class NotificationLockscreenUserManagerImpl implements * This version of the method logs a metric about the request. */ private boolean shouldShowSensitiveContentRedactedView(NotificationEntry ent) { if (!LockscreenOtpRedaction.isEnabled()) { return false; } if (ent.getRanking() == null || !ent.getRanking().hasSensitiveContent()) { return false; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +2 −9 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ import com.android.systemui.statusbar.notification.row.RowInflaterTask; import com.android.systemui.statusbar.notification.row.dagger.ExpandableNotificationRowComponent; import com.android.systemui.statusbar.notification.row.shared.AsyncGroupHeaderViewInflation; import com.android.systemui.statusbar.notification.row.shared.AsyncHybridViewInflation; import com.android.systemui.statusbar.notification.row.shared.LockscreenOtpRedaction; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import javax.inject.Inject; Loading Loading @@ -184,10 +183,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC); if (AsyncHybridViewInflation.isEnabled()) { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_SINGLE_LINE); if (LockscreenOtpRedaction.isSingleLineViewEnabled()) { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); } } mRowContentBindStage.requestRebind(entry, null); } Loading Loading @@ -271,11 +268,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { // when the group status changes params.markContentViewsFreeable(FLAG_CONTENT_VIEW_SINGLE_LINE); } } if (LockscreenOtpRedaction.isSingleLineViewEnabled()) { if (inflaterParams.isChildInGroup() && redactionType != REDACTION_TYPE_NONE) { if (inflaterParams.isChildInGroup() && redactionType != REDACTION_TYPE_NONE) { params.requireContentViews(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); } else { params.markContentViewsFreeable(FLAG_CONTENT_VIEW_PUBLIC_SINGLE_LINE); Loading