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

Commit 82ba59de authored by Chris Wren's avatar Chris Wren
Browse files

add a log for notification alerts.

Bug: 21242827
Change-Id: I1b8beee5cc12a9cd23e81554f7f2236ddc29e2b6
parent c92550e4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -75,6 +75,8 @@ option java_package com.android.server
27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1)
# replaces 27510 with a row per notification
27531 notification_visibility (key|3),(visibile|1),(lifespan|1),(freshness|1)
# a notification emited noise, vibration, or light
27532 notification_alert (key|3),(buzz|1),(beep|1),(blink|1)

# ---------------------------
# Watchdog.java
+11 −6
Original line number Diff line number Diff line
@@ -2261,7 +2261,10 @@ public class NotificationManagerService extends SystemService {
    }

    private void buzzBeepBlinkLocked(NotificationRecord record) {
        boolean buzzBeepBlinked = false;
        boolean buzz = false;
        boolean beep = false;
        boolean blink = false;

        final Notification notification = record.sbn.getNotification();

        // Should this notification make noise, vibe, or use the LED?
@@ -2343,7 +2346,7 @@ public class NotificationManagerService extends SystemService {
                                    + " with attributes " + audioAttributes);
                            player.playAsync(soundUri, record.sbn.getUser(), looping,
                                    audioAttributes);
                            buzzBeepBlinked = true;
                            beep = true;
                        }
                    } catch (RemoteException e) {
                    } finally {
@@ -2383,7 +2386,7 @@ public class NotificationManagerService extends SystemService {
                                : mFallbackVibrationPattern,
                            ((notification.flags & Notification.FLAG_INSISTENT) != 0)
                                ? 0: -1, audioAttributesForNotification(notification));
                        buzzBeepBlinked = true;
                        buzz = true;
                    } finally {
                        Binder.restoreCallingIdentity(identity);
                    }
@@ -2394,7 +2397,7 @@ public class NotificationManagerService extends SystemService {
                            notification.vibrate,
                        ((notification.flags & Notification.FLAG_INSISTENT) != 0)
                                ? 0: -1, audioAttributesForNotification(notification));
                    buzzBeepBlinked = true;
                    buzz = true;
                }
            }
        }
@@ -2408,11 +2411,13 @@ public class NotificationManagerService extends SystemService {
            if (mUseAttentionLight) {
                mAttentionLight.pulse();
            }
            buzzBeepBlinked = true;
            blink = true;
        } else if (wasShowLights) {
            updateLightsLocked();
        }
        if (buzzBeepBlinked) {
        if (buzz || beep || blink) {
            EventLogTags.writeNotificationAlert(record.getKey(),
                    buzz ? 1 : 0, beep ? 1 : 0, blink ? 1 : 0);
            mHandler.post(mBuzzBeepBlinked);
        }
    }