Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 554ab1fe authored by Yuri Lin's avatar Yuri Lin
Browse files

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
parent e79605c6
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -3319,6 +3319,22 @@
                       android:value="@string/menu_key_notifications"/>
        </activity>

        <!-- Application-level notification settings page, same as above but only accessible
             internally from system server -->
        <activity android:name="Settings$NotificationReviewPermissionsActivity"
                  android:label="@string/app_notifications_title"
                  android:icon="@drawable/ic_notifications"
                  android:exported="false">
            <intent-filter android:priority="1">
                <action android:name="android.settings.ALL_APPS_NOTIFICATION_SETTINGS_FOR_REVIEW" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                       android:value="com.android.settings.applications.manageapplications.ManageApplications" />
            <meta-data android:name="com.android.settings.HIGHLIGHT_MENU_KEY"
                       android:value="@string/menu_key_notifications"/>
        </activity>

        <!-- Show application-level notification settings (app passed in as extras) -->
        <activity android:name="Settings$AppNotificationSettingsActivity"
                android:exported="true">
+1 −0
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ public class Settings extends SettingsActivity {
    public static class AppBubbleNotificationSettingsActivity extends SettingsActivity { /* empty */ }
    public static class NotificationAssistantSettingsActivity extends SettingsActivity{ /* empty */ }
    public static class NotificationAppListActivity extends SettingsActivity { /* empty */ }
    public static class NotificationReviewPermissionsActivity extends SettingsActivity { /* empty */ }
    public static class AppNotificationSettingsActivity extends SettingsActivity { /* empty */ }
    public static class ChannelNotificationSettingsActivity extends SettingsActivity { /* empty */ }
    public static class ChannelGroupNotificationSettingsActivity extends SettingsActivity { /* empty */ }
+14 −3
Original line number Diff line number Diff line
@@ -319,12 +319,21 @@ public class ManageApplications extends InstrumentedFragment
            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;