Add screen for notification history

Bug: 137396965
Test: manual

(cherry picked from commit 84b593d592a74aeddfce453bc8700180192199ed)

Change-Id: Icac4000bd7323583f8a5f462ccb40826a4151765
This commit is contained in:
Julia Reynolds
2019-12-12 08:12:29 -05:00
parent 142e9a1e19
commit b37d565ce8
19 changed files with 1287 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
import android.app.INotificationManager;
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
import android.app.NotificationHistory;
import android.app.role.RoleManager;
import android.app.usage.IUsageStatsManager;
import android.app.usage.UsageEvents;
@@ -367,6 +368,15 @@ public class NotificationBackend {
return false;
}
public NotificationHistory getNotificationHistory(String pkg) {
try {
return sINM.getNotificationHistory(pkg);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
return new NotificationHistory();
}
protected void recordAggregatedUsageEvents(Context context, AppRow appRow) {
long now = System.currentTimeMillis();
long startTime = now - (DateUtils.DAY_IN_MILLIS * DAYS_TO_CHECK);