Methods Summary |
---|
public synchronized void | dump(java.io.PrintWriter pw, java.lang.String indent, com.android.server.notification.NotificationManagerService.DumpFilter filter)
if (ENABLE_AGGREGATED_IN_MEMORY_STATS) {
for (AggregatedStats as : mStats.values()) {
if (filter != null && !filter.matches(as.key))
continue;
as.dump(pw, indent);
}
}
if (ENABLE_SQLITE_LOG) {
mSQLiteLog.dump(pw, indent, filter);
}
|
private com.android.server.notification.NotificationUsageStats$AggregatedStats[] | getAggregatedStatsLocked(NotificationRecord record)
if (!ENABLE_AGGREGATED_IN_MEMORY_STATS) {
return EMPTY_AGGREGATED_STATS;
}
StatusBarNotification n = record.sbn;
String user = String.valueOf(n.getUserId());
String userPackage = user + ":" + n.getPackageName();
// TODO: Use pool of arrays.
return new AggregatedStats[] {
getOrCreateAggregatedStatsLocked(user),
getOrCreateAggregatedStatsLocked(userPackage),
getOrCreateAggregatedStatsLocked(n.getKey()),
};
|
private com.android.server.notification.NotificationUsageStats$AggregatedStats | getOrCreateAggregatedStatsLocked(java.lang.String key)
AggregatedStats result = mStats.get(key);
if (result == null) {
result = new AggregatedStats(key);
mStats.put(key, result);
}
return result;
|
public synchronized void | registerCancelDueToClick(NotificationRecord notification)Called when the notification is canceled because the user clicked it.
Called after {@link #registerClickedByUser(NotificationRecord)}.
notification.stats.onCancel();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.collect(notification.stats);
}
|
public synchronized void | registerCancelUnknown(NotificationRecord notification)Called when the notification is canceled due to unknown reasons.
Called for notifications of apps being uninstalled, for example.
notification.stats.onCancel();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.collect(notification.stats);
}
|
public synchronized void | registerClickedByUser(NotificationRecord notification)Called when the user clicked the notification in the UI.
notification.stats.onClick();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.numClickedByUser++;
}
if (ENABLE_SQLITE_LOG) {
mSQLiteLog.logClicked(notification);
}
|
public synchronized void | registerDismissedByUser(NotificationRecord notification)Called when the user dismissed the notification via the UI.
notification.stats.onDismiss();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.numDismissedByUser++;
stats.collect(notification.stats);
}
if (ENABLE_SQLITE_LOG) {
mSQLiteLog.logDismissed(notification);
}
|
public synchronized void | registerPostedByApp(NotificationRecord notification)Called when a notification has been posted.
notification.stats = new SingleNotificationStats();
notification.stats.posttimeElapsedMs = SystemClock.elapsedRealtime();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.numPostedByApp++;
}
if (ENABLE_SQLITE_LOG) {
mSQLiteLog.logPosted(notification);
}
|
public synchronized void | registerRemovedByApp(NotificationRecord notification)Called when the originating app removed the notification programmatically.
notification.stats.onRemoved();
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.numRemovedByApp++;
stats.collect(notification.stats);
}
if (ENABLE_SQLITE_LOG) {
mSQLiteLog.logRemoved(notification);
}
|
public void | registerUpdatedByApp(NotificationRecord notification, NotificationRecord old)Called when a notification has been updated.
notification.stats = old.stats;
for (AggregatedStats stats : getAggregatedStatsLocked(notification)) {
stats.numUpdatedByApp++;
}
|