VRManager: Set initial sleep state to 'AWAKE'

Problem:
Home screen isn't allowed to enter VR mode as part of boot.

Root-cause:
VRManager is not indicating VR Mode is allowed until the system sleep
state gets synchronized.
Because the initial sleep state during boot is AWAKE and remains AWAKE if no
lock-screen is set, VrManager fails to mark VrMode as available due to a
mismatch between its initial internal sleep state and the systems sleep state.
VrManager's initial sleep state is SLEEP, where the system's initial sleep
state is AWAKE.

Solution: Set VrManager's initial sleep state to AWAKE to match the system.

Bug: 35469244
Test: - Validated VrHome comes up properly
      - Tested VrMode is not allowed when the lock-screen is shown
      - Tested VrMode is not allowed when the display is off
      - Tested VrMode is allowed when no lock-screen is set AND the display
        is on.

Change-Id: I42e9da07db21b3ed034c4173fe329cbb7796ee7e
This commit is contained in:
Mark Urbanus
2017-02-17 12:00:54 -08:00
parent 34e8f75b68
commit 72729f9236

View File

@@ -130,7 +130,7 @@ public class VrManagerService extends SystemService implements EnabledComponentC
private final ArrayDeque<VrState> mLoggingDeque = new ArrayDeque<>(EVENT_LOG_SIZE);
private final NotificationAccessManager mNotifAccessManager = new NotificationAccessManager();
/** Tracks the state of the screen and keyguard UI.*/
private int mSystemSleepFlags = FLAG_NONE;
private int mSystemSleepFlags = FLAG_AWAKE;
private static final int MSG_VR_STATE_CHANGE = 0;
private static final int MSG_PENDING_VR_STATE_CHANGE = 1;