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

Commit 9447b83c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Assume the worst when EntryManager is missing.

It's somehow missing during pre-submit tests, so try patching over
to help tests pass.  It triggers wtf() to help ensure we chase down
to zero.

Test: sure
Bug: 72898411
Change-Id: I8972da72579f2a4d83aecc9255a74ea9406fd64f
parent c7dc046e
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -272,12 +272,20 @@ public class NotificationLockscreenUserManager implements Dumpable {
     * package-specific override.
     * package-specific override.
     */
     */
    public boolean shouldHideNotifications(String key) {
    public boolean shouldHideNotifications(String key) {
        if (mEntryManager == null) {
            Log.wtf(TAG, "mEntryManager was null!", new Throwable());
            return true;
        }
        return isLockscreenPublicMode(mCurrentUserId)
        return isLockscreenPublicMode(mCurrentUserId)
                && mEntryManager.getNotificationData().getVisibilityOverride(key) ==
                && mEntryManager.getNotificationData().getVisibilityOverride(key) ==
                        Notification.VISIBILITY_SECRET;
                        Notification.VISIBILITY_SECRET;
    }
    }


    public boolean shouldShowOnKeyguard(StatusBarNotification sbn) {
    public boolean shouldShowOnKeyguard(StatusBarNotification sbn) {
        if (mEntryManager == null) {
            Log.wtf(TAG, "mEntryManager was null!", new Throwable());
            return false;
        }
        return mShowLockscreenNotifications
        return mShowLockscreenNotifications
                && !mEntryManager.getNotificationData().isAmbient(sbn.getKey());
                && !mEntryManager.getNotificationData().isAmbient(sbn.getKey());
    }
    }
@@ -397,6 +405,10 @@ public class NotificationLockscreenUserManager implements Dumpable {
    }
    }


    private boolean packageHasVisibilityOverride(String key) {
    private boolean packageHasVisibilityOverride(String key) {
        if (mEntryManager == null) {
            Log.wtf(TAG, "mEntryManager was null!", new Throwable());
            return true;
        }
        return mEntryManager.getNotificationData().getVisibilityOverride(key) ==
        return mEntryManager.getNotificationData().getVisibilityOverride(key) ==
                Notification.VISIBILITY_PRIVATE;
                Notification.VISIBILITY_PRIVATE;
    }
    }