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

Commit fdfd4f8f authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Allow user-prioritized packages through in priority mode." into lmp-dev

parents ca4ab058 6ac5f8df
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
*/
package com.android.server.notification;

import android.app.Notification;
import android.content.Context;
import android.util.Slog;

+7 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class ZenLog {
    private static final int TYPE_UNSUBSCRIBE = 8;
    private static final int TYPE_CONFIG = 9;
    private static final int TYPE_FOLLOW_RINGER_MODE = 10;
    private static final int TYPE_NOT_INTERCEPTED = 11;

    private static int sNext;
    private static int sSize;
@@ -67,6 +68,11 @@ public class ZenLog {
        append(TYPE_INTERCEPTED, record.getKey() + "," + reason);
    }

    public static void traceNotIntercepted(NotificationRecord record, String reason) {
        if (record != null && record.isUpdate) return;  // already logged
        append(TYPE_NOT_INTERCEPTED, record.getKey() + "," + reason);
    }

    public static void traceAllowDisable(String pkg, boolean allowDisable, String reason) {
        if (SYSTEM_PACKAGES.contains(pkg)) return;
        append(TYPE_ALLOW_DISABLE, allowDisable + "," + pkg + "," + reason);
@@ -122,6 +128,7 @@ public class ZenLog {
            case TYPE_UNSUBSCRIBE: return "unsubscribe";
            case TYPE_CONFIG: return "config";
            case TYPE_FOLLOW_RINGER_MODE: return "follow_ringer_mode";
            case TYPE_NOT_INTERCEPTED: return "not_intercepted";
            default: return "unknown";
        }
    }
+7 −0
Original line number Diff line number Diff line
@@ -137,6 +137,13 @@ public class ZenModeHelper {
                }
                return false;
            }
            // allow user-prioritized packages through in priority mode
            if (mZenMode == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS) {
                if (record.getPackagePriority() == Notification.PRIORITY_MAX) {
                    ZenLog.traceNotIntercepted(record, "priorityApp");
                    return false;
                }
            }
            // audience has veto power over all following rules
            if (!audienceMatches(record)) {
                ZenLog.traceIntercepted(record, "!audienceMatches");
+1 −1

File changed.

Contains only whitespace changes.