summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2015-04-17 10:02:15 -0700
committerAmith Yamasani <yamasani@google.com>2015-04-24 16:12:01 -0700
commitf47e51ec605fccf7fed9e50d1adc98fbd4e8b340 (patch)
tree68c2fe8acf0144544d498ca413283d70d7666c53 /packages
parent4bc704655abee70c1998b9a62777cdf643920467 (diff)
downloadframeworks_base-f47e51ec605fccf7fed9e50d1adc98fbd4e8b340.zip
frameworks_base-f47e51ec605fccf7fed9e50d1adc98fbd4e8b340.tar.gz
frameworks_base-f47e51ec605fccf7fed9e50d1adc98fbd4e8b340.tar.bz2
More usage tracking
Notification listeners can now report that a notification has been seen by the user and that package is then marked as active. Bug: 20066058 Change-Id: I336040a52c44c21fd0d78b02ec9a19d448c64b40
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java21
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java2
2 files changed, 23 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index de4874f..e542264 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -700,6 +700,26 @@ public abstract class BaseStatusBar extends SystemUI implements
return isCurrentProfile(notificationUserId);
}
+ protected void setNotificationShown(StatusBarNotification n) {
+ mNotificationListener.setNotificationsShown(new String[] { n.getKey() });
+ }
+
+ protected void setNotificationsShown(String[] keys) {
+ mNotificationListener.setNotificationsShown(keys);
+ }
+
+ protected void setNotificationsShownAll() {
+ ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications();
+ final int N = activeNotifications.size();
+
+ String[] keys = new String[N];
+ for (int i = 0; i < N; i++) {
+ NotificationData.Entry entry = activeNotifications.get(i);
+ keys[i] = entry.key;
+ }
+ setNotificationsShown(keys);
+ }
+
protected boolean isCurrentProfile(int userId) {
synchronized (mCurrentProfiles) {
return userId == UserHandle.USER_ALL || mCurrentProfiles.get(userId) != null;
@@ -1681,6 +1701,7 @@ public abstract class BaseStatusBar extends SystemUI implements
boolean clearNotificationEffects =
(mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED);
mBarService.onPanelRevealed(clearNotificationEffects);
+ setNotificationsShownAll();
} else {
mBarService.onPanelHidden();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index c854d63..d058892 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1119,6 +1119,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
boolean isHeadsUped = mUseHeadsUp && shouldInterrupt(notification);
if (isHeadsUped) {
mHeadsUpManager.showNotification(shadeEntry);
+ // Mark as seen immediately
+ setNotificationShown(notification);
}
if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {