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

Commit 0c090460 authored by Robin Lee's avatar Robin Lee
Browse files

WakefulenessLifecycle: start out as AWAKE for NFFs

WakefulessLifecycle is driven by KeyguardService, which doesn't always
exist. When it doesn't exist, mWakefulness will remain set to
WAKEFULNESS_ASLEEP, which prevents some UI bits from showing up. The
most important one to fix is VolumeDialogControllerImpl.

We also need to set the default value of mDeviceInteractive to true
since the callback will never come on a device without a keyguard
service.

Test: atest SystemUITests
Fix: 190357428
Change-Id: Ib4f67e756c9549d919ec8ae640abca044d7d651f
parent ed08ff82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ public class WakefulnessLifecycle extends Lifecycle<WakefulnessLifecycle.Observe
    @Nullable
    private final IWallpaperManager mWallpaperManagerService;

    private int mWakefulness = WAKEFULNESS_ASLEEP;
    private int mWakefulness = WAKEFULNESS_AWAKE;

    private @PowerManager.WakeReason int mLastWakeReason = PowerManager.WAKE_REASON_UNKNOWN;

+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
    private boolean mShowVolumeDialog;
    private boolean mShowSafetyWarning;
    private long mLastToggledRingerOn;
    private boolean mDeviceInteractive;
    private boolean mDeviceInteractive = true;

    private boolean mDestroyed;
    private VolumePolicy mVolumePolicy;
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class WakefulnessLifecycleTest extends SysuiTestCase {

    @Test
    public void baseState() throws Exception {
        assertEquals(WakefulnessLifecycle.WAKEFULNESS_ASLEEP, mWakefulness.getWakefulness());
        assertEquals(WakefulnessLifecycle.WAKEFULNESS_AWAKE, mWakefulness.getWakefulness());

        verifyNoMoreInteractions(mWakefulnessObserver);
    }