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

Commit 5e073224 authored by Beverly's avatar Beverly
Browse files

Move notification policy log to ZenLog

- move to ZenLog to avoid log being dropped

Test: manual
Bug: 73612465
Change-Id: I9131ac3623cb0ebf69098f38b125654e469fd3af
parent c7d733fe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3166,6 +3166,7 @@ public class NotificationManagerService extends SystemService {
                        policy.priorityCallSenders, policy.priorityMessageSenders,
                        newVisualEffects);

                ZenLog.traceSetNotificationPolicy(pkg, applicationInfo.targetSdkVersion, policy);
                mZenModeHelper.setNotificationPolicy(policy);
            } catch (RemoteException e) {
            } finally {
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.notification;

import android.app.NotificationManager;
import android.content.ComponentName;
import android.media.AudioManager;
import android.net.Uri;
@@ -60,6 +61,7 @@ public class ZenLog {
    private static final int TYPE_DISABLE_EFFECTS = 13;
    private static final int TYPE_SUPPRESSOR_CHANGED = 14;
    private static final int TYPE_LISTENER_HINTS_CHANGED = 15;
    private static final int TYPE_SET_NOTIFICATION_POLICY = 16;

    private static int sNext;
    private static int sSize;
@@ -108,6 +110,12 @@ public class ZenLog {
        append(TYPE_EXIT_CONDITION, c + "," + componentToString(component) + "," + reason);
    }

    public static void traceSetNotificationPolicy(String pkg, int targetSdk,
            NotificationManager.Policy policy) {
        append(TYPE_SET_NOTIFICATION_POLICY, "pkg=" + pkg + " targetSdk=" + targetSdk
                + " NotificationPolicy=" + policy.toString());
    }

    public static void traceSubscribe(Uri uri, IConditionProvider provider, RemoteException e) {
        append(TYPE_SUBSCRIBE, uri + "," + subscribeResult(provider, e));
    }
@@ -160,6 +168,7 @@ public class ZenLog {
            case TYPE_DISABLE_EFFECTS: return "disable_effects";
            case TYPE_SUPPRESSOR_CHANGED: return "suppressor_changed";
            case TYPE_LISTENER_HINTS_CHANGED: return "listener_hints_changed";
            case TYPE_SET_NOTIFICATION_POLICY: return "set_notification_policy";
            default: return "unknown";
        }
    }