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

Commit 4fd5ac04 authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

Merge "Don't switch DND configs in ZenModeHelper upon reception of USER_UNLOCKED" into main

parents b1d9bc40 84d83cdc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2049,10 +2049,12 @@ public class NotificationManagerService extends SystemService {
                if (!mUserProfiles.isProfileUser(userId)) {
                    mConditionProviders.onUserUnlocked(userId);
                    mListeners.onUserUnlocked(userId);
                    if (!android.app.Flags.modesApi()) {
                        mZenModeHelper.onUserUnlocked(userId);
                    }
                }
            }
        }
        private boolean isProfileUnavailable(String action) {
            return allowPrivateProfile() ?
+1 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ public class ZenModeHelper {
        }
    }

    // TODO: b/310620812 - Remove when MODES_API is inlined (no more callers).
    public void onUserUnlocked(int user) {
        loadConfigForUser(user, "onUserUnlocked");
    }
+1 −1
Original line number Diff line number Diff line
@@ -5202,7 +5202,7 @@ public class ZenModeHelperTest extends UiServiceTestCase {
        // rules for a missing package, created a long time ago and deleted a long time ago
        config.deletedRules.put("del6", newZenRule("bad_pkg", twoMonthsAgo, twoMonthsAgo));

        mZenModeHelper.onUserUnlocked(42); // copies config and cleans it up.
        mZenModeHelper.onUserSwitched(42); // copies config and cleans it up.

        assertThat(mZenModeHelper.mConfig.automaticRules.keySet())
                .containsExactly("ar1", "ar2", "ar3", "ar4");