diff options
| author | Dieter Hsu <dieterhsu@google.com> | 2018-04-14 02:08:30 +0800 |
|---|---|---|
| committer | Dieter Hsu <dieterhsu@google.com> | 2018-04-18 03:28:48 +0000 |
| commit | d39f0d52dcdca78fb8d57fa0a805ec0bdc8589da (patch) | |
| tree | 53626d24af3778a0f8a467c71778628f6a8f5565 /core/java | |
| parent | 52842feb146cac0ee72d866b16a1ce8e3d8b5fdf (diff) | |
Add rank & count event to notification clicks and dismisses
For click/action click/dismiss, passing rank(0-based) and
count at the time of the actions to events.
Bug: 70724602
Test: runtest systemui-notification
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/notification
Change-Id: I07c440f84ccb745f744eb4e317881b72d2b41683
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/statusbar/IStatusBarService.aidl | 7 | ||||
| -rw-r--r-- | core/java/com/android/internal/statusbar/NotificationVisibility.java | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index 2b7221a1eb55..159d49bc0009 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -54,12 +54,13 @@ interface IStatusBarService void onPanelHidden(); // Mark current notifications as "seen" and stop ringing, vibrating, blinking. void clearNotificationEffects(); - void onNotificationClick(String key); - void onNotificationActionClick(String key, int actionIndex); + void onNotificationClick(String key, in NotificationVisibility nv); + void onNotificationActionClick(String key, int actionIndex, in NotificationVisibility nv); void onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId); void onClearAllNotifications(int userId); - void onNotificationClear(String pkg, String tag, int id, int userId, String key, int dismissalSurface); + void onNotificationClear(String pkg, String tag, int id, int userId, String key, + int dismissalSurface, in NotificationVisibility nv); void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys); void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); diff --git a/core/java/com/android/internal/statusbar/NotificationVisibility.java b/core/java/com/android/internal/statusbar/NotificationVisibility.java index 2139ad02e4f3..7fe440cf0b89 100644 --- a/core/java/com/android/internal/statusbar/NotificationVisibility.java +++ b/core/java/com/android/internal/statusbar/NotificationVisibility.java @@ -32,6 +32,7 @@ public class NotificationVisibility implements Parcelable { public String key; public int rank; + public int count; public boolean visible = true; /*package*/ int id; @@ -39,10 +40,11 @@ public class NotificationVisibility implements Parcelable { id = sNexrId++; } - private NotificationVisibility(String key, int rank, boolean visibile) { + private NotificationVisibility(String key, int rank, int count, boolean visibile) { this(); this.key = key; this.rank = rank; + this.count = count; this.visible = visibile; } @@ -51,13 +53,14 @@ public class NotificationVisibility implements Parcelable { return "NotificationVisibility(id=" + id + "key=" + key + " rank=" + rank + + " count=" + count + (visible?" visible":"") + " )"; } @Override public NotificationVisibility clone() { - return obtain(this.key, this.rank, this.visible); + return obtain(this.key, this.rank, this.count, this.visible); } @Override @@ -85,12 +88,14 @@ public class NotificationVisibility implements Parcelable { public void writeToParcel(Parcel out, int flags) { out.writeString(this.key); out.writeInt(this.rank); + out.writeInt(this.count); out.writeInt(this.visible ? 1 : 0); } private void readFromParcel(Parcel in) { this.key = in.readString(); this.rank = in.readInt(); + this.count = in.readInt(); this.visible = in.readInt() != 0; } @@ -98,10 +103,11 @@ public class NotificationVisibility implements Parcelable { * Return a new NotificationVisibility instance from the global pool. Allows us to * avoid allocating new objects in many cases. */ - public static NotificationVisibility obtain(String key, int rank, boolean visible) { + public static NotificationVisibility obtain(String key, int rank, int count, boolean visible) { NotificationVisibility vo = obtain(); vo.key = key; vo.rank = rank; + vo.count = count; vo.visible = visible; return vo; } |
