Loading core/java/com/android/internal/statusbar/IStatusBarService.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -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); Loading core/java/com/android/internal/statusbar/NotificationVisibility.java +9 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading @@ -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 Loading Loading @@ -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; } Loading @@ -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; } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +8 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,14 @@ public class NotificationData { return null; } public int getRank(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return mTmpRanking.getRank(); } return 0; } public boolean shouldHide(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import android.view.ViewGroup; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.MetricsLogger; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.util.NotificationMessagingUtil; import com.android.systemui.DejankUtils; import com.android.systemui.Dependency; Loading Loading @@ -367,6 +368,10 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. } public void performRemoveNotification(StatusBarNotification n) { final int rank = mNotificationData.getRank(n.getKey()); final int count = mNotificationData.getActiveNotifications().size(); final NotificationVisibility nv = NotificationVisibility.obtain(n.getKey(), rank, count, true); NotificationData.Entry entry = mNotificationData.get(n.getKey()); mRemoteInputManager.onPerformRemoveNotification(n, entry); final String pkg = n.getPackageName(); Loading @@ -380,7 +385,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. } else if (mListContainer.hasPulsingNotifications()) { dismissalSurface = NotificationStats.DISMISSAL_AOD; } mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface); mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface, nv); removeNotification(n.getKey(), null); } catch (RemoteException ex) { Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.widget.TextView; import android.widget.Toast; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; Loading Loading @@ -129,8 +130,13 @@ public class NotificationLockscreenUserManager implements Dumpable { } } if (notificationKey != null) { final int count = mEntryManager.getNotificationData().getActiveNotifications().size(); final int rank = mEntryManager.getNotificationData().getRank(notificationKey); final NotificationVisibility nv = NotificationVisibility.obtain(notificationKey, rank, count, true); try { mBarService.onNotificationClick(notificationKey); mBarService.onNotificationClick(notificationKey, nv); } catch (RemoteException e) { /* ignore */ } Loading Loading
core/java/com/android/internal/statusbar/IStatusBarService.aidl +4 −3 Original line number Diff line number Diff line Loading @@ -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); Loading
core/java/com/android/internal/statusbar/NotificationVisibility.java +9 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading @@ -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 Loading Loading @@ -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; } Loading @@ -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; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +8 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,14 @@ public class NotificationData { return null; } public int getRank(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); return mTmpRanking.getRank(); } return 0; } public boolean shouldHide(String key) { if (mRankingMap != null) { getRanking(key, mTmpRanking); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import android.view.ViewGroup; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.MetricsLogger; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.util.NotificationMessagingUtil; import com.android.systemui.DejankUtils; import com.android.systemui.Dependency; Loading Loading @@ -367,6 +368,10 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. } public void performRemoveNotification(StatusBarNotification n) { final int rank = mNotificationData.getRank(n.getKey()); final int count = mNotificationData.getActiveNotifications().size(); final NotificationVisibility nv = NotificationVisibility.obtain(n.getKey(), rank, count, true); NotificationData.Entry entry = mNotificationData.get(n.getKey()); mRemoteInputManager.onPerformRemoveNotification(n, entry); final String pkg = n.getPackageName(); Loading @@ -380,7 +385,7 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater. } else if (mListContainer.hasPulsingNotifications()) { dismissalSurface = NotificationStats.DISMISSAL_AOD; } mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface); mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface, nv); removeNotification(n.getKey(), null); } catch (RemoteException ex) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.widget.TextView; import android.widget.Toast; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; Loading Loading @@ -129,8 +130,13 @@ public class NotificationLockscreenUserManager implements Dumpable { } } if (notificationKey != null) { final int count = mEntryManager.getNotificationData().getActiveNotifications().size(); final int rank = mEntryManager.getNotificationData().getRank(notificationKey); final NotificationVisibility nv = NotificationVisibility.obtain(notificationKey, rank, count, true); try { mBarService.onNotificationClick(notificationKey); mBarService.onNotificationClick(notificationKey, nv); } catch (RemoteException e) { /* ignore */ } Loading