Populate recent notifying apps from usage events

Which is the data source that the screen this widget
links to uses

Test: robotests
Fixes: 131641848
Change-Id: I02ce178823e72b3b3606ad4f7110587b6dc0afe3
This commit is contained in:
Julia Reynolds
2019-05-02 16:44:52 -04:00
parent 6aab54e4be
commit abb04be44d
4 changed files with 225 additions and 74 deletions

View File

@@ -21,10 +21,13 @@ import static com.android.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;
import android.app.Activity;
import android.app.Application;
import android.app.settings.SettingsEnums;
import android.app.usage.IUsageStatsManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.SearchIndexableResource;
import android.text.TextUtils;
@@ -112,7 +115,9 @@ public class ConfigureNotificationSettings extends DashboardFragment implements
lifecycle.addObserver(lockScreenNotificationController);
}
controllers.add(new RecentNotifyingAppsPreferenceController(
context, new NotificationBackend(), app, host));
context, new NotificationBackend(), IUsageStatsManager.Stub.asInterface(
ServiceManager.getService(Context.USAGE_STATS_SERVICE)),
context.getSystemService(UserManager.class), app, host));
controllers.add(lockScreenNotificationController);
controllers.add(new NotificationRingtonePreferenceController(context) {
@Override