Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,7 @@ interface IStatusBarService void onNotificationClear(String pkg, String tag, int id, int userId); void onNotificationClear(String pkg, String tag, int id, int userId); void onNotificationVisibilityChanged( void onNotificationVisibilityChanged( in String[] newlyVisibleKeys, in String[] noLongerVisibleKeys); in String[] newlyVisibleKeys, in String[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void setSystemUiVisibility(int vis, int mask); void setSystemUiVisibility(int vis, int mask); void setHardKeyboardEnabled(boolean enabled); void setHardKeyboardEnabled(boolean enabled); void setWindowState(int window, int state); void setWindowState(int window, int state); Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ import static com.android.keyguard.KeyguardHostView.OnDismissAction; public abstract class BaseStatusBar extends SystemUI implements public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener, CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener, RecentsComponent.Callbacks { RecentsComponent.Callbacks, ExpandableNotificationRow.ExpansionLogger { public static final String TAG = "StatusBar"; public static final String TAG = "StatusBar"; public static final boolean DEBUG = false; public static final boolean DEBUG = false; public static final boolean MULTIUSER_DEBUG = false; public static final boolean MULTIUSER_DEBUG = false; Loading Loading @@ -1035,6 +1035,7 @@ public abstract class BaseStatusBar extends SystemUI implements Context.LAYOUT_INFLATER_SERVICE); Context.LAYOUT_INFLATER_SERVICE); row = (ExpandableNotificationRow) inflater.inflate(R.layout.status_bar_notification_row, row = (ExpandableNotificationRow) inflater.inflate(R.layout.status_bar_notification_row, parent, false); parent, false); row.setExpansionLogger(this, entry.notification.getKey()); } } // the notification inspector (see SwipeHelper.setLongPressListener) // the notification inspector (see SwipeHelper.setLongPressListener) Loading Loading @@ -1784,4 +1785,13 @@ public abstract class BaseStatusBar extends SystemUI implements } } return contextForUser.getPackageManager(); return contextForUser.getPackageManager(); } } @Override public void logNotificationExpansion(String key, boolean userAction, boolean expanded) { try { mBarService.onNotificationExpansionChanged(key, userAction, expanded); } catch (RemoteException e) { // Ignore. } } } } packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private int mMaxExpandHeight; private int mMaxExpandHeight; private View mVetoButton; private View mVetoButton; private boolean mClearable; private boolean mClearable; private ExpansionLogger mLogger; private String mLoggingKey; public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } public ExpandableNotificationRow(Context context, AttributeSet attrs) { public ExpandableNotificationRow(Context context, AttributeSet attrs) { super(context, attrs); super(context, attrs); Loading @@ -66,6 +72,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { public void reset() { public void reset() { super.reset(); super.reset(); mRowMinHeight = 0; mRowMinHeight = 0; final boolean wasExpanded = isExpanded(); mRowMaxHeight = 0; mRowMaxHeight = 0; mExpandable = false; mExpandable = false; mHasUserChangedExpansion = false; mHasUserChangedExpansion = false; Loading @@ -76,6 +83,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mPublicLayout.reset(); mPublicLayout.reset(); mPrivateLayout.reset(); mPrivateLayout.reset(); mMaxExpandHeight = 0; mMaxExpandHeight = 0; logExpansionEvent(false, wasExpanded); } } @Override @Override Loading Loading @@ -131,8 +139,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { */ */ public void setUserExpanded(boolean userExpanded) { public void setUserExpanded(boolean userExpanded) { if (userExpanded && !mExpandable) return; if (userExpanded && !mExpandable) return; final boolean wasExpanded = isExpanded(); mHasUserChangedExpansion = true; mHasUserChangedExpansion = true; mUserExpanded = userExpanded; mUserExpanded = userExpanded; logExpansionEvent(true, wasExpanded); } } public boolean isUserLocked() { public boolean isUserLocked() { Loading @@ -156,15 +166,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { * @param expand whether the system wants this notification to be expanded. * @param expand whether the system wants this notification to be expanded. */ */ public void setSystemExpanded(boolean expand) { public void setSystemExpanded(boolean expand) { final boolean wasExpanded = isExpanded(); mIsSystemExpanded = expand; mIsSystemExpanded = expand; notifyHeightChanged(); notifyHeightChanged(); logExpansionEvent(false, wasExpanded); } } /** /** * @param expansionDisabled whether to prevent notification expansion * @param expansionDisabled whether to prevent notification expansion */ */ public void setExpansionDisabled(boolean expansionDisabled) { public void setExpansionDisabled(boolean expansionDisabled) { final boolean wasExpanded = isExpanded(); mExpansionDisabled = expansionDisabled; mExpansionDisabled = expansionDisabled; logExpansionEvent(false, wasExpanded); notifyHeightChanged(); notifyHeightChanged(); } } Loading Loading @@ -302,4 +316,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private NotificationContentView getShowingLayout() { private NotificationContentView getShowingLayout() { return mShowingPublic ? mPublicLayout : mPrivateLayout; return mShowingPublic ? mPublicLayout : mPrivateLayout; } } public void setExpansionLogger(ExpansionLogger logger, String key) { mLogger = logger; mLoggingKey = key; } private void logExpansionEvent(boolean userAction, boolean wasExpanded) { final boolean nowExpanded = isExpanded(); if (wasExpanded != nowExpanded && mLogger != null) { mLogger.logNotificationExpansion(mLoggingKey, userAction, nowExpanded) ; } } } } services/core/java/com/android/server/EventLogTags.logtags +2 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,8 @@ option java_package com.android.server 27501 notification_panel_hidden 27501 notification_panel_hidden # when notifications are newly displayed on screen, or disappear from screen # when notifications are newly displayed on screen, or disappear from screen 27510 notification_visibility_changed (newlyVisibleKeys|3),(noLongerVisibleKeys|3) 27510 notification_visibility_changed (newlyVisibleKeys|3),(noLongerVisibleKeys|3) # when notifications are expanded, or contracted 27511 notification_expansion (key|3),(user_action|1),(expanded|1) # when a notification has been clicked # when a notification has been clicked 27520 notification_clicked (key|3) 27520 notification_clicked (key|3) Loading services/core/java/com/android/server/notification/NotificationDelegate.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -32,4 +32,5 @@ public interface NotificationDelegate { boolean allowDisable(int what, IBinder token, String pkg); boolean allowDisable(int what, IBinder token, String pkg); void onNotificationVisibilityChanged( void onNotificationVisibilityChanged( String[] newlyVisibleKeys, String[] noLongerVisibleKeys); String[] newlyVisibleKeys, String[] noLongerVisibleKeys); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); } } Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -49,6 +49,7 @@ interface IStatusBarService void onNotificationClear(String pkg, String tag, int id, int userId); void onNotificationClear(String pkg, String tag, int id, int userId); void onNotificationVisibilityChanged( void onNotificationVisibilityChanged( in String[] newlyVisibleKeys, in String[] noLongerVisibleKeys); in String[] newlyVisibleKeys, in String[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); void setSystemUiVisibility(int vis, int mask); void setSystemUiVisibility(int vis, int mask); void setHardKeyboardEnabled(boolean enabled); void setHardKeyboardEnabled(boolean enabled); void setWindowState(int window, int state); void setWindowState(int window, int state); Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -96,7 +96,7 @@ import static com.android.keyguard.KeyguardHostView.OnDismissAction; public abstract class BaseStatusBar extends SystemUI implements public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener, CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener, RecentsComponent.Callbacks { RecentsComponent.Callbacks, ExpandableNotificationRow.ExpansionLogger { public static final String TAG = "StatusBar"; public static final String TAG = "StatusBar"; public static final boolean DEBUG = false; public static final boolean DEBUG = false; public static final boolean MULTIUSER_DEBUG = false; public static final boolean MULTIUSER_DEBUG = false; Loading Loading @@ -1035,6 +1035,7 @@ public abstract class BaseStatusBar extends SystemUI implements Context.LAYOUT_INFLATER_SERVICE); Context.LAYOUT_INFLATER_SERVICE); row = (ExpandableNotificationRow) inflater.inflate(R.layout.status_bar_notification_row, row = (ExpandableNotificationRow) inflater.inflate(R.layout.status_bar_notification_row, parent, false); parent, false); row.setExpansionLogger(this, entry.notification.getKey()); } } // the notification inspector (see SwipeHelper.setLongPressListener) // the notification inspector (see SwipeHelper.setLongPressListener) Loading Loading @@ -1784,4 +1785,13 @@ public abstract class BaseStatusBar extends SystemUI implements } } return contextForUser.getPackageManager(); return contextForUser.getPackageManager(); } } @Override public void logNotificationExpansion(String key, boolean userAction, boolean expanded) { try { mBarService.onNotificationExpansionChanged(key, userAction, expanded); } catch (RemoteException e) { // Ignore. } } } }
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private int mMaxExpandHeight; private int mMaxExpandHeight; private View mVetoButton; private View mVetoButton; private boolean mClearable; private boolean mClearable; private ExpansionLogger mLogger; private String mLoggingKey; public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } public ExpandableNotificationRow(Context context, AttributeSet attrs) { public ExpandableNotificationRow(Context context, AttributeSet attrs) { super(context, attrs); super(context, attrs); Loading @@ -66,6 +72,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { public void reset() { public void reset() { super.reset(); super.reset(); mRowMinHeight = 0; mRowMinHeight = 0; final boolean wasExpanded = isExpanded(); mRowMaxHeight = 0; mRowMaxHeight = 0; mExpandable = false; mExpandable = false; mHasUserChangedExpansion = false; mHasUserChangedExpansion = false; Loading @@ -76,6 +83,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mPublicLayout.reset(); mPublicLayout.reset(); mPrivateLayout.reset(); mPrivateLayout.reset(); mMaxExpandHeight = 0; mMaxExpandHeight = 0; logExpansionEvent(false, wasExpanded); } } @Override @Override Loading Loading @@ -131,8 +139,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { */ */ public void setUserExpanded(boolean userExpanded) { public void setUserExpanded(boolean userExpanded) { if (userExpanded && !mExpandable) return; if (userExpanded && !mExpandable) return; final boolean wasExpanded = isExpanded(); mHasUserChangedExpansion = true; mHasUserChangedExpansion = true; mUserExpanded = userExpanded; mUserExpanded = userExpanded; logExpansionEvent(true, wasExpanded); } } public boolean isUserLocked() { public boolean isUserLocked() { Loading @@ -156,15 +166,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { * @param expand whether the system wants this notification to be expanded. * @param expand whether the system wants this notification to be expanded. */ */ public void setSystemExpanded(boolean expand) { public void setSystemExpanded(boolean expand) { final boolean wasExpanded = isExpanded(); mIsSystemExpanded = expand; mIsSystemExpanded = expand; notifyHeightChanged(); notifyHeightChanged(); logExpansionEvent(false, wasExpanded); } } /** /** * @param expansionDisabled whether to prevent notification expansion * @param expansionDisabled whether to prevent notification expansion */ */ public void setExpansionDisabled(boolean expansionDisabled) { public void setExpansionDisabled(boolean expansionDisabled) { final boolean wasExpanded = isExpanded(); mExpansionDisabled = expansionDisabled; mExpansionDisabled = expansionDisabled; logExpansionEvent(false, wasExpanded); notifyHeightChanged(); notifyHeightChanged(); } } Loading Loading @@ -302,4 +316,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private NotificationContentView getShowingLayout() { private NotificationContentView getShowingLayout() { return mShowingPublic ? mPublicLayout : mPrivateLayout; return mShowingPublic ? mPublicLayout : mPrivateLayout; } } public void setExpansionLogger(ExpansionLogger logger, String key) { mLogger = logger; mLoggingKey = key; } private void logExpansionEvent(boolean userAction, boolean wasExpanded) { final boolean nowExpanded = isExpanded(); if (wasExpanded != nowExpanded && mLogger != null) { mLogger.logNotificationExpansion(mLoggingKey, userAction, nowExpanded) ; } } } }
services/core/java/com/android/server/EventLogTags.logtags +2 −0 Original line number Original line Diff line number Diff line Loading @@ -65,6 +65,8 @@ option java_package com.android.server 27501 notification_panel_hidden 27501 notification_panel_hidden # when notifications are newly displayed on screen, or disappear from screen # when notifications are newly displayed on screen, or disappear from screen 27510 notification_visibility_changed (newlyVisibleKeys|3),(noLongerVisibleKeys|3) 27510 notification_visibility_changed (newlyVisibleKeys|3),(noLongerVisibleKeys|3) # when notifications are expanded, or contracted 27511 notification_expansion (key|3),(user_action|1),(expanded|1) # when a notification has been clicked # when a notification has been clicked 27520 notification_clicked (key|3) 27520 notification_clicked (key|3) Loading
services/core/java/com/android/server/notification/NotificationDelegate.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -32,4 +32,5 @@ public interface NotificationDelegate { boolean allowDisable(int what, IBinder token, String pkg); boolean allowDisable(int what, IBinder token, String pkg); void onNotificationVisibilityChanged( void onNotificationVisibilityChanged( String[] newlyVisibleKeys, String[] noLongerVisibleKeys); String[] newlyVisibleKeys, String[] noLongerVisibleKeys); void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); } }