diff options
author | Christoph Studer <chstuder@google.com> | 2014-03-21 13:10:21 +0100 |
---|---|---|
committer | Christoph Studer <chstuder@google.com> | 2014-04-07 14:52:17 -0400 |
commit | 760ea554d0022fd88bbe13e3ef7c75cbe8613af6 (patch) | |
tree | 8d867287b61f46dfa2e9ee54ee876df0a9c55435 | |
parent | 012785d8cbaadb4041707af350e122ad29d22151 (diff) | |
download | frameworks_base-760ea554d0022fd88bbe13e3ef7c75cbe8613af6.zip frameworks_base-760ea554d0022fd88bbe13e3ef7c75cbe8613af6.tar.gz frameworks_base-760ea554d0022fd88bbe13e3ef7c75cbe8613af6.tar.bz2 |
Write eventlog entries for notification panel visibility
Change-Id: Ie7e15ed15739cb5f057c900e1cadf90824b2b4ef
6 files changed, 29 insertions, 2 deletions
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index 4734712..dfdb9ae 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -41,6 +41,7 @@ interface IStatusBarService out List<IBinder> notificationKeys, out List<StatusBarNotification> notifications, out int[] switches, out List<IBinder> binders); void onPanelRevealed(); + void onPanelHidden(); void onNotificationClick(String pkg, String tag, int id, int userId); void onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index f349036..844b964 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -970,7 +970,11 @@ public abstract class BaseStatusBar extends SystemUI implements if (mPanelSlightlyVisible != visible) { mPanelSlightlyVisible = visible; try { - mBarService.onPanelRevealed(); + if (visible) { + mBarService.onPanelRevealed(); + } else { + mBarService.onPanelHidden(); + } } catch (RemoteException ex) { // Won't fail unless the world has ended. } diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags index 0f78c9b..9768934 100644 --- a/services/core/java/com/android/server/EventLogTags.logtags +++ b/services/core/java/com/android/server/EventLogTags.logtags @@ -58,7 +58,11 @@ option java_package com.android.server 2751 notification_cancel (uid|1|5),(pid|1|5),(pkg|3),(id|1|5),(tag|3),(userid|1|5),(required_flags|1),(forbidden_flags|1),(reason|1|5),(listener|3) # when someone tries to cancel all of the notifications for a particular package 2752 notification_cancel_all (uid|1|5),(pid|1|5),(pkg|3),(userid|1|5),(required_flags|1),(forbidden_flags|1),(reason|1|5),(listener|3) - +# when the notification panel is shown +# Note: New tag range starts here since 2753+ have been used below. +27500 notification_panel_revealed +# when the notification panel is hidden +27501 notification_panel_hidden # --------------------------- # Watchdog.java diff --git a/services/core/java/com/android/server/notification/NotificationDelegate.java b/services/core/java/com/android/server/notification/NotificationDelegate.java index 4c8dcc3..e0591a2 100644 --- a/services/core/java/com/android/server/notification/NotificationDelegate.java +++ b/services/core/java/com/android/server/notification/NotificationDelegate.java @@ -29,5 +29,6 @@ public interface NotificationDelegate { String pkg, String tag, int id, int uid, int initialPid, String message, int userId); void onPanelRevealed(); + void onPanelHidden(); boolean allowDisable(int what, IBinder token, String pkg); } diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 3b6d288..f9411a4 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -966,6 +966,7 @@ public class NotificationManagerService extends SystemService { @Override public void onPanelRevealed() { + EventLogTags.writeNotificationPanelRevealed(); synchronized (mNotificationList) { // sound mSoundNotification = null; @@ -998,6 +999,11 @@ public class NotificationManagerService extends SystemService { } @Override + public void onPanelHidden() { + EventLogTags.writeNotificationPanelHidden(); + } + + @Override public void onNotificationError(int callingUid, int callingPid, String pkg, String tag, int id, int uid, int initialPid, String message, int userId) { Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java index 4ce02c1..e4b5f3a 100644 --- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java +++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java @@ -535,6 +535,17 @@ public class StatusBarManagerService extends IStatusBarService.Stub } @Override + public void onPanelHidden() throws RemoteException { + enforceStatusBarService(); + long identity = Binder.clearCallingIdentity(); + try { + mNotificationDelegate.onPanelHidden(); + } finally { + Binder.restoreCallingIdentity(identity); + } + } + + @Override public void onNotificationClick(String pkg, String tag, int id, int userId) { enforceStatusBarService(); final int callingUid = Binder.getCallingUid(); |