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

Commit 369280f4 authored by Nate Myren's avatar Nate Myren
Browse files

Remove redact_sensitive_content_notifications_on_lockscreen flag

It is eligible for cleanup

Test: atest NotificationLockscreenUserManagerTest
Fixes: 423940645
Flag: EXEMPT FLAG_REMOVAL
Change-Id: I49ff51e77076d482e618f42570788247908dcab1
parent 3df32c4e
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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"
+1 −27
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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;
@@ -548,7 +547,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,
@@ -569,7 +567,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,
@@ -589,7 +586,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,
@@ -609,7 +605,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,
@@ -630,7 +625,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,
@@ -651,25 +645,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,
@@ -686,7 +661,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,
+0 −4
Original line number Diff line number Diff line
@@ -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
@@ -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 {
@@ -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"
@@ -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"
+1 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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(),
@@ -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;
        }
+2 −9
Original line number Diff line number Diff line
@@ -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;
@@ -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);
    }

@@ -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