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

Commit c92d6790 authored by Yuri Lin's avatar Yuri Lin
Browse files

Default summaries on for droid/nextfooders.

This change resets the XML attribute name, thus resetting the overall enabled setting on both bundles and summaries. As this would render the "is setting set by user" tracking for bundles outdated as well, it also resets that parameter. This will set both bundles and summaries to default ON, with bundles off for the work profile.

Bug: 433554352
Test: NotificationManagerServiceTest, NotificationAssistantsTest; manual by setting all settings opposite the default (bundles on for work profile but off overall, summaries off) and confirming that patching this change resets these settings.
Flag: android.app.nm_summarization_onboarding_ui
Change-Id: Idcd1b56ae63045732f9334a86af09606f4b6fad1
parent 156b0ed8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -12544,7 +12544,7 @@ public class NotificationManagerService extends SystemService {
        private static final String ATT_TYPES = "types";
        private static final String TAG_DENIED = android.app.Flags.nmSummarizationOnboardingUi()
                ? "denied_adjustment_keys"
                ? "denied_adjustment_keys-temp"  // TODO: b/433554352 - restore tag for launch
                : "user_denied_adjustments";
        private static final String TAG_DENIED_KEY = "adjustment";
        private static final String ATT_DENIED_KEY = "key";
@@ -12553,7 +12553,8 @@ public class NotificationManagerService extends SystemService {
        private static final String ATT_NAS_UNSUPPORTED = "unsupported_adjustments";
        private static final String ATT_USER_ID = "user";
        // for classification only, but named a bit more generally in case this ever gets expanded
        private static final String TAG_SET_BY_USERS = "adjustment_pref_set_by_users";
        // TODO: b/433554352 - restore tag for launch
        private static final String TAG_SET_BY_USERS = "adjustment_pref_set_by_users-temp";
        private static final String ATT_USER_LIST = "users";
        private final Object mLock = new Object();
@@ -12785,7 +12786,9 @@ public class NotificationManagerService extends SystemService {
            Set<String> denied = new HashSet<>();
            if (android.app.Flags.nmSummarizationOnboardingUi()) {
                if (!mDeniedAdjustments.containsKey(userId)) {
                    mDeniedAdjustments.put(userId, new ArraySet<>(List.of(KEY_SUMMARIZATION)));
                    // TODO: b/433554352 - restore denying summarization by default for launch
                    // mDeniedAdjustments.put(userId, new ArraySet<>(List.of(KEY_SUMMARIZATION)));
                    mDeniedAdjustments.put(userId, new ArraySet<>());
                }
                denied.addAll(mDeniedAdjustments.get(userId));
            } else {
+2 −0
Original line number Diff line number Diff line
@@ -822,9 +822,11 @@ public class NotificationAssistantsTest extends UiServiceTestCase {

        ArrayList<String> expected = new ArrayList<>(List.of(DEFAULT_ALLOWED_ADJUSTMENTS));

        /* TODO: b/433554352 - restore when summarization is disabled by default again
        if (android.app.Flags.nmSummarizationOnboardingUi()) {
            expected.remove(KEY_SUMMARIZATION);
        }
         */

        assertThat(mAssistants.getAllowedAssistantAdjustments(mZero.id))
                .containsExactlyElementsIn(expected);