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

Commit ddd236f2 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Add temp logging for zen policy changes

Because by the time you notice the policy has changed
the zen log has likely rolled over

Test: manual in logcat
Bug: 180205791
Change-Id: I766ce6609464e58f9a63c5be8eb5ddfc24bb4a5c
parent b7ef42dc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.service.notification.Condition;
import android.service.notification.IConditionProvider;
import android.service.notification.NotificationListenerService;
import android.service.notification.ZenModeConfig;
import android.util.Log;
import android.util.Slog;

import java.io.PrintWriter;
@@ -122,8 +123,11 @@ public class ZenLog {

    public static void traceSetNotificationPolicy(String pkg, int targetSdk,
            NotificationManager.Policy policy) {
        append(TYPE_SET_NOTIFICATION_POLICY, "pkg=" + pkg + " targetSdk=" + targetSdk
                + " NotificationPolicy=" + policy.toString());
        String policyLog = "pkg=" + pkg + " targetSdk=" + targetSdk
                + " NotificationPolicy=" + policy.toString();
        append(TYPE_SET_NOTIFICATION_POLICY, policyLog);
        // TODO(b/180205791): remove when we can better surface apps that are changing policy
        Log.d(TAG, "Zen Policy Changed: " + policyLog);
    }

    public static void traceSubscribe(Uri uri, IConditionProvider provider, RemoteException e) {