Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ interface IStatusBarService void onPanelRevealed(); void onPanelHidden(); void onNotificationClick(String key); void onNotificationActionClick(String key, int actionIndex); void onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId); void onClearAllNotifications(int userId); Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +33 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewStub; import android.view.WindowManager; import android.view.WindowManagerGlobal; Loading Loading @@ -266,6 +267,7 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) { Log.v(TAG, "Notification click handler invoked for intent: " + pendingIntent); } logActionClick(view); // The intent we are sending is for the application, which // won't have permission to immediately start an activity after // the user switches to home. We know it is safe to do at this Loading Loading @@ -308,6 +310,37 @@ public abstract class BaseStatusBar extends SystemUI implements } } private void logActionClick(View view) { ViewParent parent = view.getParent(); String key = getNotificationKeyForParent(parent); if (key == null) { Log.w(TAG, "Couldn't determine notification for click."); return; } int index = -1; // If this is a default template, determine the index of the button. if (view.getId() == com.android.internal.R.id.action0 && parent != null && parent instanceof ViewGroup) { ViewGroup actionGroup = (ViewGroup) parent; index = actionGroup.indexOfChild(view); } try { mBarService.onNotificationActionClick(key, index); } catch (RemoteException e) { // Ignore } } private String getNotificationKeyForParent(ViewParent parent) { while (parent != null) { if (parent instanceof ExpandableNotificationRow) { return ((ExpandableNotificationRow) parent).getStatusBarNotification().getKey(); } parent = parent.getParent(); } return null; } private boolean superOnClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return super.onClickHandler(view, pendingIntent, fillInIntent); Loading services/core/java/com/android/server/EventLogTags.logtags +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ option java_package com.android.server 27511 notification_expansion (key|3),(user_action|1),(expanded|1) # when a notification has been clicked 27520 notification_clicked (key|3) # when a notification action button has been clicked 27521 notification_action_clicked (key|3),(action_index|1) # --------------------------- # Watchdog.java Loading services/core/java/com/android/server/notification/NotificationDelegate.java +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ public interface NotificationDelegate { void onSetDisabled(int status); void onClearAll(int callingUid, int callingPid, int userId); void onNotificationClick(int callingUid, int callingPid, String key); void onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex); void onNotificationClear(int callingUid, int callingPid, String pkg, String tag, int id, int userId); void onNotificationError(int callingUid, int callingPid, Loading services/core/java/com/android/server/notification/NotificationManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,20 @@ public class NotificationManagerService extends SystemService { } } @Override public void onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex) { synchronized (mNotificationList) { EventLogTags.writeNotificationActionClicked(key, actionIndex); NotificationRecord r = mNotificationsByKey.get(key); if (r == null) { Log.w(TAG, "No notification with key: " + key); return; } // TODO: Log action click via UsageStats. } } @Override public void onNotificationClear(int callingUid, int callingPid, String pkg, String tag, int id, int userId) { Loading Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ interface IStatusBarService void onPanelRevealed(); void onPanelHidden(); void onNotificationClick(String key); void onNotificationActionClick(String key, int actionIndex); void onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId); void onClearAllNotifications(int userId); Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +33 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewStub; import android.view.WindowManager; import android.view.WindowManagerGlobal; Loading Loading @@ -266,6 +267,7 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) { Log.v(TAG, "Notification click handler invoked for intent: " + pendingIntent); } logActionClick(view); // The intent we are sending is for the application, which // won't have permission to immediately start an activity after // the user switches to home. We know it is safe to do at this Loading Loading @@ -308,6 +310,37 @@ public abstract class BaseStatusBar extends SystemUI implements } } private void logActionClick(View view) { ViewParent parent = view.getParent(); String key = getNotificationKeyForParent(parent); if (key == null) { Log.w(TAG, "Couldn't determine notification for click."); return; } int index = -1; // If this is a default template, determine the index of the button. if (view.getId() == com.android.internal.R.id.action0 && parent != null && parent instanceof ViewGroup) { ViewGroup actionGroup = (ViewGroup) parent; index = actionGroup.indexOfChild(view); } try { mBarService.onNotificationActionClick(key, index); } catch (RemoteException e) { // Ignore } } private String getNotificationKeyForParent(ViewParent parent) { while (parent != null) { if (parent instanceof ExpandableNotificationRow) { return ((ExpandableNotificationRow) parent).getStatusBarNotification().getKey(); } parent = parent.getParent(); } return null; } private boolean superOnClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) { return super.onClickHandler(view, pendingIntent, fillInIntent); Loading
services/core/java/com/android/server/EventLogTags.logtags +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ option java_package com.android.server 27511 notification_expansion (key|3),(user_action|1),(expanded|1) # when a notification has been clicked 27520 notification_clicked (key|3) # when a notification action button has been clicked 27521 notification_action_clicked (key|3),(action_index|1) # --------------------------- # Watchdog.java Loading
services/core/java/com/android/server/notification/NotificationDelegate.java +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ public interface NotificationDelegate { void onSetDisabled(int status); void onClearAll(int callingUid, int callingPid, int userId); void onNotificationClick(int callingUid, int callingPid, String key); void onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex); void onNotificationClear(int callingUid, int callingPid, String pkg, String tag, int id, int userId); void onNotificationError(int callingUid, int callingPid, Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,20 @@ public class NotificationManagerService extends SystemService { } } @Override public void onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex) { synchronized (mNotificationList) { EventLogTags.writeNotificationActionClicked(key, actionIndex); NotificationRecord r = mNotificationsByKey.get(key); if (r == null) { Log.w(TAG, "No notification with key: " + key); return; } // TODO: Log action click via UsageStats. } } @Override public void onNotificationClear(int callingUid, int callingPid, String pkg, String tag, int id, int userId) { Loading