Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinator.kt +7 −0 Original line number Diff line number Diff line Loading @@ -63,9 +63,16 @@ class SensitiveContentCoordinatorImpl @Inject constructor( SensitiveContentCoordinator, DynamicPrivacyController.Listener, OnBeforeRenderListListener { private val onSensitiveStateChanged = Runnable() { invalidateList("onSensitiveStateChanged") } override fun attach(pipeline: NotifPipeline) { dynamicPrivacyController.addListener(this) if (screenshareNotificationHiding()) { sensitiveNotificationProtectionController .registerSensitiveStateListener(onSensitiveStateChanged) } pipeline.addOnBeforeRenderListListener(this) pipeline.addPreRenderInvalidator(this) } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,26 @@ class SensitiveContentCoordinatorTest : SysuiTestCase() { verify(invalidationListener).onPluggableInvalidated(eq(invalidator), any()) } @Test @EnableFlags(FLAG_SCREENSHARE_NOTIFICATION_HIDING) fun onSensitiveStateChanged_invokeInvalidationListener() { coordinator.attach(pipeline) val invalidator = withArgCaptor<Invalidator> { verify(pipeline).addPreRenderInvalidator(capture()) } val onSensitiveStateChangedListener = withArgCaptor<Runnable> { verify(sensitiveNotificationProtectionController) .registerSensitiveStateListener(capture()) } val invalidationListener = mock<Pluggable.PluggableListener<Invalidator>>() invalidator.setInvalidationListener(invalidationListener) onSensitiveStateChangedListener.run() verify(invalidationListener).onPluggableInvalidated(eq(invalidator), any()) } @Test fun onBeforeRenderList_deviceUnlocked_notifDoesNotNeedRedaction() { coordinator.attach(pipeline) Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinator.kt +7 −0 Original line number Diff line number Diff line Loading @@ -63,9 +63,16 @@ class SensitiveContentCoordinatorImpl @Inject constructor( SensitiveContentCoordinator, DynamicPrivacyController.Listener, OnBeforeRenderListListener { private val onSensitiveStateChanged = Runnable() { invalidateList("onSensitiveStateChanged") } override fun attach(pipeline: NotifPipeline) { dynamicPrivacyController.addListener(this) if (screenshareNotificationHiding()) { sensitiveNotificationProtectionController .registerSensitiveStateListener(onSensitiveStateChanged) } pipeline.addOnBeforeRenderListListener(this) pipeline.addPreRenderInvalidator(this) } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,26 @@ class SensitiveContentCoordinatorTest : SysuiTestCase() { verify(invalidationListener).onPluggableInvalidated(eq(invalidator), any()) } @Test @EnableFlags(FLAG_SCREENSHARE_NOTIFICATION_HIDING) fun onSensitiveStateChanged_invokeInvalidationListener() { coordinator.attach(pipeline) val invalidator = withArgCaptor<Invalidator> { verify(pipeline).addPreRenderInvalidator(capture()) } val onSensitiveStateChangedListener = withArgCaptor<Runnable> { verify(sensitiveNotificationProtectionController) .registerSensitiveStateListener(capture()) } val invalidationListener = mock<Pluggable.PluggableListener<Invalidator>>() invalidator.setInvalidationListener(invalidationListener) onSensitiveStateChangedListener.run() verify(invalidationListener).onPluggableInvalidated(eq(invalidator), any()) } @Test fun onBeforeRenderList_deviceUnlocked_notifDoesNotNeedRedaction() { coordinator.attach(pipeline) Loading