OSDN Git Service

Merge "Refresh screen off timeout when screen lock is released in VR" into oc-dev
authorAndrii Kulian <akulian@google.com>
Fri, 26 May 2017 23:15:14 +0000 (23:15 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 26 May 2017 23:15:19 +0000 (23:15 +0000)
1  2 
services/core/java/com/android/server/power/PowerManagerService.java

@@@ -1940,7 -1940,8 +1940,8 @@@ public final class PowerManagerService 
                          && mLastUserActivityTimeNoChangeLights >= mLastWakeTime) {
                      nextTimeout = mLastUserActivityTimeNoChangeLights + screenOffTimeout;
                      if (now < nextTimeout) {
-                         if (mDisplayPowerRequest.policy == DisplayPowerRequest.POLICY_BRIGHT) {
+                         if (mDisplayPowerRequest.policy == DisplayPowerRequest.POLICY_BRIGHT
+                                 || mDisplayPowerRequest.policy == DisplayPowerRequest.POLICY_VR) {
                              mUserActivitySummary = USER_ACTIVITY_SCREEN_BRIGHT;
                          } else if (mDisplayPowerRequest.policy == DisplayPowerRequest.POLICY_DIM) {
                              mUserActivitySummary = USER_ACTIVITY_SCREEN_DIM;
          if (reason == null) {
              reason = "";
          }
 -        if (reason.equals(PowerManager.REBOOT_RECOVERY)
 -                || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) {
 -            reason = "recovery";
 -        }
  
          // If the reason is "quiescent", it means that the boot process should proceed
          // without turning on the screen/lights.
          if (reason.equals(PowerManager.REBOOT_QUIESCENT)) {
              sQuiescent = true;
              reason = "";
 +        } else if (reason.endsWith("," + PowerManager.REBOOT_QUIESCENT)) {
 +            sQuiescent = true;
 +            reason = reason.substring(0,
 +                    reason.length() - PowerManager.REBOOT_QUIESCENT.length() - 1);
 +        }
 +
 +        if (reason.equals(PowerManager.REBOOT_RECOVERY)
 +                || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) {
 +            reason = "recovery";
          }
  
          if (sQuiescent) {