Special handling for intent coming from "welcome" notification.

This notification is an introduction to new notification permission changes in T and is shown to the user upon upgrade; this change records that the user has seen/interacted with the notification already so we don't have to keep showing it.

This change essentially makes a copy of the existing functionality of NotificationAppListActivity, but meant only for access internally (so that neither the activity nor the associated action is exported/publicly accessible).

Bug: 225373531
Test: manual with the change that sends the notification
Change-Id: I20c6084652ea11a8d0a002a21561fe50b9cf5de3
This commit is contained in:
Yuri Lin
2022-04-12 17:05:49 -04:00
parent e79605c652
commit 554ab1fe3e
3 changed files with 31 additions and 3 deletions

View File

@@ -315,16 +315,25 @@ public class ManageApplications extends InstrumentedFragment
mListType = LIST_TYPE_WIFI_ACCESS;
} else if (className.equals(Settings.ManageExternalStorageActivity.class.getName())) {
mListType = LIST_MANAGE_EXTERNAL_STORAGE;
} else if (className.equals(Settings.MediaManagementAppsActivity.class.getName())) {
} else if (className.equals(Settings.MediaManagementAppsActivity.class.getName())) {
mListType = LIST_TYPE_MEDIA_MANAGEMENT_APPS;
} else if (className.equals(Settings.AlarmsAndRemindersActivity.class.getName())) {
mListType = LIST_TYPE_ALARMS_AND_REMINDERS;
} else if (className.equals(Settings.NotificationAppListActivity.class.getName())) {
} else if (className.equals(Settings.NotificationAppListActivity.class.getName())
|| className.equals(
Settings.NotificationReviewPermissionsActivity.class.getName())) {
mListType = LIST_TYPE_NOTIFICATION;
mUsageStatsManager = IUsageStatsManager.Stub.asInterface(
ServiceManager.getService(Context.USAGE_STATS_SERVICE));
mNotificationBackend = new NotificationBackend();
mSortOrder = R.id.sort_order_recent_notification;
if (className.equals(Settings.NotificationReviewPermissionsActivity.class.getName())) {
// Special-case for a case where a user is directed to the all apps notification
// preferences page via a notification prompt to review permissions settings.
android.provider.Settings.Secure.putInt(getContext().getContentResolver(),
android.provider.Settings.Secure.REVIEW_PERMISSIONS_NOTIFICATION_STATE,
1); // USER_INTERACTED
}
} else if (className.equals(AppLocaleDetails.class.getName())) {
mListType = LIST_TYPE_APPS_LOCALE;
} else {
@@ -915,7 +924,9 @@ public class ManageApplications extends InstrumentedFragment
screenTitle = R.string.media_management_apps_title;
} else if (className.equals(Settings.AlarmsAndRemindersActivity.class.getName())) {
screenTitle = R.string.alarms_and_reminders_title;
} else if (className.equals(Settings.NotificationAppListActivity.class.getName())) {
} else if (className.equals(Settings.NotificationAppListActivity.class.getName())
|| className.equals(
Settings.NotificationReviewPermissionsActivity.class.getName())) {
screenTitle = R.string.app_notifications_title;
} else if (className.equals(AppLocaleDetails.class.getName())) {
screenTitle = R.string.app_locales_picker_menu_title;