Loading services/core/java/com/android/server/notification/NotificationUsageStats.java +18 −6 Original line number Diff line number Diff line Loading @@ -46,12 +46,14 @@ import java.util.Map; * {@hide} */ public class NotificationUsageStats { private static final boolean ENABLE_SQLITE_LOG = true; // Guarded by synchronized(this). private final Map<String, AggregatedStats> mStats = new HashMap<String, AggregatedStats>(); private final SQLiteLog mSQLiteLog; public NotificationUsageStats(Context context) { mSQLiteLog = new SQLiteLog(context); mSQLiteLog = ENABLE_SQLITE_LOG ? new SQLiteLog(context) : null; } /** Loading @@ -63,8 +65,10 @@ public class NotificationUsageStats { for (AggregatedStats stats : getAggregatedStatsLocked(notification)) { stats.numPostedByApp++; } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logPosted(notification); } } /** * Called when a notification has been updated. Loading @@ -85,8 +89,10 @@ public class NotificationUsageStats { stats.numRemovedByApp++; stats.collect(notification.stats); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logRemoved(notification); } } /** * Called when the user dismissed the notification via the UI. Loading @@ -97,8 +103,10 @@ public class NotificationUsageStats { stats.numDismissedByUser++; stats.collect(notification.stats); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logDismissed(notification); } } /** * Called when the user clicked the notification in the UI. Loading @@ -108,8 +116,10 @@ public class NotificationUsageStats { for (AggregatedStats stats : getAggregatedStatsLocked(notification)) { stats.numClickedByUser++; } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logClicked(notification); } } /** * Called when the notification is canceled because the user clicked it. Loading Loading @@ -164,8 +174,10 @@ public class NotificationUsageStats { for (AggregatedStats as : mStats.values()) { as.dump(pw, indent); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.dump(pw, indent); } } /** * Aggregated notification stats. Loading Loading
services/core/java/com/android/server/notification/NotificationUsageStats.java +18 −6 Original line number Diff line number Diff line Loading @@ -46,12 +46,14 @@ import java.util.Map; * {@hide} */ public class NotificationUsageStats { private static final boolean ENABLE_SQLITE_LOG = true; // Guarded by synchronized(this). private final Map<String, AggregatedStats> mStats = new HashMap<String, AggregatedStats>(); private final SQLiteLog mSQLiteLog; public NotificationUsageStats(Context context) { mSQLiteLog = new SQLiteLog(context); mSQLiteLog = ENABLE_SQLITE_LOG ? new SQLiteLog(context) : null; } /** Loading @@ -63,8 +65,10 @@ public class NotificationUsageStats { for (AggregatedStats stats : getAggregatedStatsLocked(notification)) { stats.numPostedByApp++; } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logPosted(notification); } } /** * Called when a notification has been updated. Loading @@ -85,8 +89,10 @@ public class NotificationUsageStats { stats.numRemovedByApp++; stats.collect(notification.stats); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logRemoved(notification); } } /** * Called when the user dismissed the notification via the UI. Loading @@ -97,8 +103,10 @@ public class NotificationUsageStats { stats.numDismissedByUser++; stats.collect(notification.stats); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logDismissed(notification); } } /** * Called when the user clicked the notification in the UI. Loading @@ -108,8 +116,10 @@ public class NotificationUsageStats { for (AggregatedStats stats : getAggregatedStatsLocked(notification)) { stats.numClickedByUser++; } if (ENABLE_SQLITE_LOG) { mSQLiteLog.logClicked(notification); } } /** * Called when the notification is canceled because the user clicked it. Loading Loading @@ -164,8 +174,10 @@ public class NotificationUsageStats { for (AggregatedStats as : mStats.values()) { as.dump(pw, indent); } if (ENABLE_SQLITE_LOG) { mSQLiteLog.dump(pw, indent); } } /** * Aggregated notification stats. Loading