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

Commit 15e8acb3 authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Re-add check for invalid device state

This check was removed, but should have been kept.

Bug:352667244
Test: atest LogicalDisplayMapperTest
Flag: android.hardware.devicestate.feature.flags.device_state_property_migration
Change-Id: I9d0add2bc1d19eda90d8b44275adb424b164df0b
parent 2f85e4b3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.hardware.devicestate.DeviceState;
import android.hardware.devicestate.DeviceStateManager;
import android.hardware.devicestate.feature.flags.FeatureFlags;
import android.hardware.devicestate.feature.flags.FeatureFlagsImpl;
import android.os.Handler;
@@ -614,7 +615,11 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
                    && isBootCompleted
                    && !mFoldSettingProvider.shouldStayAwakeOnFold();
        } else {
            return mDeviceStatesOnWhichToSelectiveSleep.get(pendingState.getIdentifier())
            return currentState.getIdentifier()
                    != DeviceStateManager.INVALID_DEVICE_STATE_IDENTIFIER
                    && pendingState.getIdentifier()
                    != DeviceStateManager.INVALID_DEVICE_STATE_IDENTIFIER
                    && mDeviceStatesOnWhichToSelectiveSleep.get(pendingState.getIdentifier())
                    && !mDeviceStatesOnWhichToSelectiveSleep.get(currentState.getIdentifier())
                    && isInteractive
                    && isBootCompleted