DO NOT MERGE Doze-Pulsing should always go to display on
The only exception is if the device requires a blank frame before turning the display back on. Test: atest DozeMachineTest Test: make a phone call, then enter AOD and attempt UDFPS to see HBM Bug: 213875085 Change-Id: Ia3025c1b6e479180edf489dcb53dec8f81f7820f
This commit is contained in:
@@ -118,9 +118,11 @@ public class DozeMachine {
|
|||||||
switch (this) {
|
switch (this) {
|
||||||
case UNINITIALIZED:
|
case UNINITIALIZED:
|
||||||
case INITIALIZED:
|
case INITIALIZED:
|
||||||
case DOZE_REQUEST_PULSE:
|
|
||||||
return parameters.shouldControlScreenOff() ? Display.STATE_ON
|
return parameters.shouldControlScreenOff() ? Display.STATE_ON
|
||||||
: Display.STATE_OFF;
|
: Display.STATE_OFF;
|
||||||
|
case DOZE_REQUEST_PULSE:
|
||||||
|
return parameters.getDisplayNeedsBlanking() ? Display.STATE_OFF
|
||||||
|
: Display.STATE_ON;
|
||||||
case DOZE_AOD_PAUSED:
|
case DOZE_AOD_PAUSED:
|
||||||
case DOZE:
|
case DOZE:
|
||||||
return Display.STATE_OFF;
|
return Display.STATE_OFF;
|
||||||
|
|||||||
@@ -42,12 +42,14 @@ import static org.mockito.Mockito.when;
|
|||||||
import android.hardware.display.AmbientDisplayConfiguration;
|
import android.hardware.display.AmbientDisplayConfiguration;
|
||||||
import android.testing.AndroidTestingRunner;
|
import android.testing.AndroidTestingRunner;
|
||||||
import android.testing.UiThreadTest;
|
import android.testing.UiThreadTest;
|
||||||
|
import android.view.Display;
|
||||||
|
|
||||||
import androidx.test.filters.SmallTest;
|
import androidx.test.filters.SmallTest;
|
||||||
|
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.dock.DockManager;
|
import com.android.systemui.dock.DockManager;
|
||||||
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
import com.android.systemui.keyguard.WakefulnessLifecycle;
|
||||||
|
import com.android.systemui.statusbar.phone.DozeParameters;
|
||||||
import com.android.systemui.statusbar.policy.BatteryController;
|
import com.android.systemui.statusbar.policy.BatteryController;
|
||||||
import com.android.systemui.util.wakelock.WakeLockFake;
|
import com.android.systemui.util.wakelock.WakeLockFake;
|
||||||
|
|
||||||
@@ -444,4 +446,20 @@ public class DozeMachineTest extends SysuiTestCase {
|
|||||||
|
|
||||||
assertTrue(mServiceFake.requestedWakeup);
|
assertTrue(mServiceFake.requestedWakeup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDozePulsing_displayRequiresBlanking_screenState() {
|
||||||
|
DozeParameters dozeParameters = mock(DozeParameters.class);
|
||||||
|
when(dozeParameters.getDisplayNeedsBlanking()).thenReturn(true);
|
||||||
|
|
||||||
|
assertEquals(Display.STATE_OFF, DOZE_REQUEST_PULSE.screenState(dozeParameters));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDozePulsing_displayDoesNotRequireBlanking_screenState() {
|
||||||
|
DozeParameters dozeParameters = mock(DozeParameters.class);
|
||||||
|
when(dozeParameters.getDisplayNeedsBlanking()).thenReturn(false);
|
||||||
|
|
||||||
|
assertEquals(Display.STATE_ON, DOZE_REQUEST_PULSE.screenState(dozeParameters));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user