From 72729f9236a6c26dfef3eb4de14f3bd4ffe0318f Mon Sep 17 00:00:00 2001 From: Mark Urbanus Date: Fri, 17 Feb 2017 12:00:54 -0800 Subject: [PATCH] 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 --- services/core/java/com/android/server/vr/VrManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/vr/VrManagerService.java b/services/core/java/com/android/server/vr/VrManagerService.java index 21a4f74e5a75c..d179ea703d1ec 100644 --- a/services/core/java/com/android/server/vr/VrManagerService.java +++ b/services/core/java/com/android/server/vr/VrManagerService.java @@ -130,7 +130,7 @@ public class VrManagerService extends SystemService implements EnabledComponentC private final ArrayDeque 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;