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

Commit 7d9f2b74 authored by Manasi Navare's avatar Manasi Navare Committed by Android (Google) Code Review
Browse files

Merge "Remove Display Manager flag display_config_error_hal" into main

parents 26ba3da1 bd106dd7
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -76,10 +76,6 @@ public class DisplayManagerFlags {
            com.android.graphics.surfaceflinger.flags.Flags.FLAG_ENABLE_SMALL_AREA_DETECTION,
            com.android.graphics.surfaceflinger.flags.Flags::enableSmallAreaDetection);

    private final FlagState mDisplayConfigErrorHalFlagState = new FlagState(
            com.android.graphics.surfaceflinger.flags.Flags.FLAG_DISPLAY_CONFIG_ERROR_HAL,
            com.android.graphics.surfaceflinger.flags.Flags::displayConfigErrorHal);

    private final FlagState mSyncedResolutionSwitch = new FlagState(
            com.android.graphics.surfaceflinger.flags.Flags.FLAG_SYNCED_RESOLUTION_SWITCH,
            com.android.graphics.surfaceflinger.flags.Flags::syncedResolutionSwitch
@@ -334,10 +330,6 @@ public class DisplayManagerFlags {
        return mSmallAreaDetectionFlagState.isEnabled();
    }

    public boolean isDisplayConfigErrorHalEnabled() {
        return mDisplayConfigErrorHalFlagState.isEnabled();
    }

    public boolean isSyncedResolutionSwitchEnabled() {
        return mSyncedResolutionSwitch.isEnabled();
    }
@@ -576,7 +568,6 @@ public class DisplayManagerFlags {
        pw.println(" " + mPowerThrottlingClamperFlagState);
        pw.println(" " + mEvenDimmerFlagState);
        pw.println(" " + mSmallAreaDetectionFlagState);
        pw.println(" " + mDisplayConfigErrorHalFlagState);
        pw.println(" " + mSyncedResolutionSwitch);
        pw.println(" " + mBrightnessWearBedtimeModeClamperFlagState);
        pw.println(" " + mAutoBrightnessModesFlagState);
+10 −4
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public class DisplayModeDirector {
        mDisplayObserver = new DisplayObserver(context, handler, mVotesStorage, injector);
        mSensorObserver = new ProximitySensorObserver(mVotesStorage, injector);
        mSkinThermalStatusObserver = new SkinThermalStatusObserver(injector, mVotesStorage);
        mModeChangeObserver = new ModeChangeObserver(mVotesStorage, injector, handler.getLooper());
        mModeChangeObserver = mInjector.getModeChangeObserver(mVotesStorage, handler.getLooper());
        mHbmObserver = new HbmObserver(injector, mVotesStorage, BackgroundThread.getHandler(),
                mDeviceConfigDisplaySettings);
        mSystemRequestObserver = mInjector.getSystemRequestObserver(mVotesStorage);
@@ -273,9 +273,8 @@ public class DisplayModeDirector {
        mSensorObserver.observe();
        mHbmObserver.observe();
        mSkinThermalStatusObserver.observe();
        if (mDisplayManagerFlags.isDisplayConfigErrorHalEnabled()) {
        mModeChangeObserver.observe();
        }

        synchronized (mLock) {
            // We may have a listener already registered before the call to start, so go ahead and
            // notify them to pick up our newly initialized state.
@@ -3169,6 +3168,8 @@ public class DisplayModeDirector {
        AmbientFilter getAmbientFilter(Resources res);

        SystemRequestObserver getSystemRequestObserver(VotesStorage votesStorage);

        ModeChangeObserver getModeChangeObserver(VotesStorage votesStorage, Looper looper);
    }

    @VisibleForTesting
@@ -3328,6 +3329,11 @@ public class DisplayModeDirector {
            return new SystemRequestObserver(votesStorage);
        }

        @Override
        public ModeChangeObserver getModeChangeObserver(VotesStorage votesStorage, Looper looper) {
            return new ModeChangeObserver(votesStorage, this, looper);
        }

        private DisplayManager getDisplayManager() {
            if (mDisplayManager == null) {
                mDisplayManager = mContext.getSystemService(DisplayManager.class);
+5 −0
Original line number Diff line number Diff line
@@ -4021,6 +4021,11 @@ public class DisplayModeDirectorTest {
            return mock(SystemRequestObserver.class);
        }

        @Override
        public ModeChangeObserver getModeChangeObserver(VotesStorage votesStorage, Looper looper) {
            return mock(ModeChangeObserver.class);
        }

        protected Display createDisplay(int id) {
            return new Display(DisplayManagerGlobal.getInstance(), id, mDisplayInfo,
                    ApplicationProvider.getApplicationContext().getResources());
+3 −0
Original line number Diff line number Diff line
@@ -520,6 +520,9 @@ public class DisplayObserverTest {

        when(mInjector.getDisplays()).thenReturn(new Display[] {mDefaultDisplay, mExternalDisplay});

        when(mInjector.getModeChangeObserver(any(), any()))
                .thenReturn(mock(ModeChangeObserver.class));

        mDmd = new DisplayModeDirector(mContext, mHandler, mInjector,
                mDisplayManagerFlags, mDisplayDeviceConfigProvider);
        mDmd.start(null);