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

Commit b12b57fb authored by archisha's avatar archisha Committed by Archisha Baranwal
Browse files

Improve cache invalidation criteria for night mode and current mode type.

Remove cache invalidation for night mode and current mode type in
UiModeManagerService in case of redundant 'set' of the concerned property.

Bug: 362572732
Flag: android.app.enable_current_mode_type_binder_cache
Test: UiModeManagerServiceTest
Change-Id: Ife4cf68248319c225c539a85812ad2a9dfb90bf2
parent a7c08b43
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -153,11 +153,13 @@ final class UiModeManagerService extends SystemService {

        @Override
        public void set(int mode) {
            if (mNightModeValue != mode) {
                mNightModeValue = mode;
                if (enableNightModeBinderCache()) {
                    UiModeManager.invalidateNightModeCache();
                }
            }
        }
    };
    private int mNightModeCustomType = UiModeManager.MODE_NIGHT_CUSTOM_TYPE_UNKNOWN;
    private int mAttentionModeThemeOverlay = UiModeManager.MODE_ATTENTION_THEME_OVERLAY_OFF;
@@ -207,11 +209,13 @@ final class UiModeManagerService extends SystemService {

        @Override
        public void set(int mode) {
            if (mCurrentModeTypeValue != mode) {
                mCurrentModeTypeValue = mode;
                if (enableCurrentModeTypeBinderCache()) {
                    UiModeManager.invalidateCurrentModeTypeCache();
                }
            }
        }
    };
    private int mSetUiMode = 0;
    private boolean mHoldingConfiguration = false;