Merge "Update text on notification on/off toggles for clarity"
diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
index 9b20e7a..9efe34e 100644
--- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
@@ -97,7 +97,7 @@
app == null ? null : ApplicationsState.getInstance(app), host);
}
- @VisibleForTesting(otherwise = VisibleForTesting.NONE)
+ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
RecentNotifyingAppsPreferenceController(Context context, NotificationBackend backend,
IUsageStatsManager usageStatsManager, UserManager userManager,
ApplicationsState appState, Fragment host) {
@@ -118,7 +118,7 @@
@Override
public boolean isAvailable() {
- return true;
+ return mApplicationsState != null;
}
@Override
@@ -307,9 +307,6 @@
if (appEntry == null) {
continue;
}
- if (!shouldIncludePkgInRecents(app.getPackage(), app.getUserId())) {
- continue;
- }
displayableApps.add(app);
count++;
if (count >= SHOW_RECENT_APP_COUNT) {
@@ -318,24 +315,4 @@
}
return displayableApps;
}
-
-
- /**
- * Whether or not the app should be included in recent list.
- */
- private boolean shouldIncludePkgInRecents(String pkgName, int userId) {
- final Intent launchIntent = new Intent().addCategory(Intent.CATEGORY_LAUNCHER)
- .setPackage(pkgName);
-
- if (mPm.resolveActivity(launchIntent, 0) == null) {
- // Not visible on launcher -> likely not a user visible app, skip if non-instant.
- final ApplicationsState.AppEntry appEntry =
- mApplicationsState.getEntry(pkgName, userId);
- if (appEntry == null || appEntry.info == null || !AppUtils.isInstant(appEntry.info)) {
- Log.d(TAG, "Not a user visible or instant app, skipping " + pkgName);
- return false;
- }
- }
- return true;
- }
}