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

Commit 014ad591 authored by John Spurlock's avatar John Spurlock
Browse files

Display intercepted notifications if configured.

Don't suppress notifications if the user has configured them
to display, even in zen mode.

Change-Id: Ief549164cafd0922726feaeaf2029b8840dcf735
parent 5639828a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
import android.os.Process;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
import android.util.ArrayMap;
import android.view.View;
@@ -59,6 +60,7 @@ public class InterceptedNotifications {

    public boolean tryIntercept(IBinder key, StatusBarNotification notification) {
        if (!notification.getNotification().extras.getBoolean(EXTRA_INTERCEPT)) return false;
        if (shouldDisplayIntercepted()) return false;
        mIntercepted.put(key, notification);
        updateSyntheticNotification();
        return true;
@@ -80,6 +82,11 @@ public class InterceptedNotifications {
        }
    }

    private boolean shouldDisplayIntercepted() {
        return Settings.Secure.getInt(mContext.getContentResolver(),
                Settings.Secure.DISPLAY_INTERCEPTED_NOTIFICATIONS, 0) != 0;
    }

    private void updateSyntheticNotification() {
        if (mIntercepted.isEmpty()) {
            if (mSynKey != null) {