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

Commit 5b1b2b15 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Fix setApplicationNightMode did not persist night mode." into sc-dev

parents f7aca051 45dddb33
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -6471,12 +6471,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                        Slog.w(TAG, "Override application configuration: cannot find pid " + mPid);
                        return;
                    }
                    if (wpc.getNightMode() == mNightMode) {
                        return;
                    }
                    if (!wpc.setOverrideNightMode(mNightMode)) {
                        return;
                    }
                    wpc.setOverrideNightMode(mNightMode);
                    wpc.updateNightModeForAllActivities(mNightMode);
                    mPackageConfigPersister.updateFromImpl(wpc.mName, wpc.mUserId, this);
                } finally {
+2 −6
Original line number Diff line number Diff line
@@ -545,8 +545,8 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
     * @return true if the nightMode has been changed.
     */
    public boolean setOverrideNightMode(int nightMode) {
        final int currentUiMode = mFullConfiguration.uiMode;
        final int currentNightMode = getNightMode();
        final int currentUiMode = mRequestedOverrideConfiguration.uiMode;
        final int currentNightMode = currentUiMode & Configuration.UI_MODE_NIGHT_MASK;
        final int validNightMode = nightMode & Configuration.UI_MODE_NIGHT_MASK;
        if (currentNightMode == validNightMode) {
            return false;
@@ -558,10 +558,6 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
        return true;
    }

    int getNightMode() {
        return mFullConfiguration.uiMode & Configuration.UI_MODE_NIGHT_MASK;
    }

    public boolean isActivityTypeDream() {
        return getActivityType() == ACTIVITY_TYPE_DREAM;
    }