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

Commit 37d08161 authored by Nate Myren's avatar Nate Myren
Browse files

Remove metrics flag for lockscreen redaction

Under new gantry rules, it is eligible for cleanup

Bug: 409611920
Test: atest NotificationLockscreenUserManagerTest
Flag: EXEMPT cleaning up
Change-Id: I61a9a689bf7d833106f17d0d59c3215bb77f8207
parent 63e8deb6
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -255,16 +255,6 @@ flag {
  bug: "343631648"
}

flag {
  name: "redaction_on_lockscreen_metrics"
  namespace: "systemui"
  description: "enables metrics when redacting notifications on the lockscreen"
  bug: "343631648"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
  name: "expanding_public_view"
  namespace: "systemui"
+1 −52
Original line number Diff line number Diff line
@@ -800,57 +800,6 @@ public class NotificationLockscreenUserManagerImpl implements
        return REDACTION_TYPE_NONE;
    }

    /*
     * We show the sensitive content redaction view if
     * 1. The feature is enabled
     * 2. The device is locked
     * 3. The device is NOT connected to Wifi
     * 4. The notification has the `hasSensitiveContent` ranking variable set to true
     * 5. The device has not connected to Wifi since receiving the notification
     * 6. The notification arrived at least LOCK_TIME_FOR_SENSITIVE_REDACTION_MS before the last
     *    lock time.
     */
    private boolean shouldShowSensitiveContentRedactedView(NotificationEntry ent) {
        if (android.app.Flags.redactionOnLockscreenMetrics()) {
            return shouldShowSensitiveContentRedactedViewWithLog(ent);
        }

        if (!LockscreenOtpRedaction.isEnabled()) {
            return false;
        }

        if (!mLocked.get()) {
            return false;
        }

        long notificationTime = getEarliestNotificationTime(ent);
        if (!mRedactOtpOnWifi.get()) {
            if (mConnectedToWifi.get()) {
                return false;
            }

            long lastWifiConnectTime = mLastWifiConnectionTime.get();
            // If the device has connected to wifi since receiving the notification, do not redact
            if (notificationTime < lastWifiConnectTime) {
                return false;
            }
        }

        if (ent.getRanking() == null || !ent.getRanking().hasSensitiveContent()) {
            return false;
        }

        // If the lock screen was not already locked for at least mOtpRedactionRequiredLockTimeMs
        // when this notification arrived, do not redact
        long latestTimeForRedaction = mLastLockTime.get() + mOtpRedactionRequiredLockTimeMs.get();

        if (notificationTime < latestTimeForRedaction) {
            return false;
        }

        return true;
    }

    /*
     * We show the sensitive content redaction view if
     * 1. The feature is enabled
@@ -863,7 +812,7 @@ public class NotificationLockscreenUserManagerImpl implements
     *
     * This version of the method logs a metric about the request.
     */
    private boolean shouldShowSensitiveContentRedactedViewWithLog(NotificationEntry ent) {
    private boolean shouldShowSensitiveContentRedactedView(NotificationEntry ent) {
        if (!LockscreenOtpRedaction.isEnabled()) {
            return false;
        }