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

Commit c29b969f authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

invalidate NotifFilter onStrongAuthStateChanged

When strong auth changes, the lockdown mode could change which
changes whether we show certain notifications so we must invalidate
the KeyguardCoordinator's NotifFilter to prevent b/78020486.

Test: manual
Bug: 145659174
Bug: 145134683
Change-Id: I5e7ad481fad1323943ac7bfe6d858efd0b8a0b32
parent 38e2d687
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -139,6 +139,8 @@ public class ForegroundServiceController {
            }
        }

        // TODO: (b/145659174) remove when moving to NewNotifPipeline. Replaced by
        //  ForegroundCoordinator
        // Update appOp if there's an associated pending or visible notification:
        final String foregroundKey = getStandardLayoutKey(userId, packageName);
        if (foregroundKey != null) {
+5 −2
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@ public class ForegroundServiceNotificationListener {
            NotifCollection notifCollection) {
        mContext = context;
        mForegroundServiceController = foregroundServiceController;

        // TODO: (b/145659174) remove mEntryManager when moving to NewNotifPipeline. Replaced by
        //  ForegroundCoordinator
        mEntryManager = notificationEntryManager;
        mEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
            @Override
@@ -171,8 +174,8 @@ public class ForegroundServiceNotificationListener {
                true /* create if not found */);
    }

    // TODO: remove this when fully migrated to the NewNotifPipeline (work done in
    //  ForegroundCoordinator)
    // TODO: (b/145659174) remove when moving to NewNotifPipeline. Replaced by
    //  ForegroundCoordinator
    private void tagForeground(NotificationEntry entry) {
        final StatusBarNotification sbn = entry.getSbn();
        ArraySet<Integer> activeOps = mForegroundServiceController.getAppOps(
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ public class NotificationListController {
        }
    };

    // TODO: (b/145659174) remove after moving to NewNotifPipeline. Replaced by
    //  DeviceProvisionedCoordinator
    private final DeviceProvisionedListener mDeviceProvisionedListener =
            new DeviceProvisionedListener() {
                @Override
+11 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.service.notification.StatusBarNotification;
import androidx.annotation.MainThread;

import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
@@ -165,6 +166,7 @@ public class KeyguardCoordinator implements Coordinator {
    private void setupInvalidateNotifListCallbacks() {
        // register onKeyguardShowing callback
        mKeyguardStateController.addCallback(mKeyguardCallback);
        mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateCallback);

        // register lockscreen settings changed callbacks:
        final ContentObserver settingsObserver = new ContentObserver(mMainHandler) {
@@ -230,4 +232,13 @@ public class KeyguardCoordinator implements Coordinator {
                    invalidateListFromFilter("onStatusBarStateChanged");
                }
    };

    private final KeyguardUpdateMonitorCallback mKeyguardUpdateCallback =
            new KeyguardUpdateMonitorCallback() {
        @Override
        public void onStrongAuthStateChanged(int userId) {
            // maybe lockdown mode changed
            invalidateListFromFilter("onStrongAuthStateChanged");
        }
    };
}
+2 −0
Original line number Diff line number Diff line
@@ -583,6 +583,8 @@ public class StatusBar extends SystemUI implements DemoMode,
                    }
                }

                // TODO: (b/145659174) remove when moving to NewNotifPipeline. Replaced by
                //  KeyguardCoordinator
                @Override
                public void onStrongAuthStateChanged(int userId) {
                    super.onStrongAuthStateChanged(userId);