rename UiModeManager.ENABLE_CAR_MODE_NO_WAKE_LOCK to ENABLE_CAR_MODE_ALLOW_SLEEP
bug: 16959030
Change-Id: I413a2ba676488bfc18e393465b98681682ec88d4
diff --git a/api/current.txt b/api/current.txt
index d1b2efd..77dc76e 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5239,7 +5239,7 @@
field public static java.lang.String ACTION_EXIT_DESK_MODE;
field public static final int DISABLE_CAR_MODE_GO_HOME = 1; // 0x1
field public static final int ENABLE_CAR_MODE_GO_CAR_HOME = 1; // 0x1
- field public static final int ENABLE_CAR_MODE_NO_WAKE_LOCK = 2; // 0x2
+ field public static final int ENABLE_CAR_MODE_ALLOW_SLEEP = 2; // 0x2
field public static final int MODE_NIGHT_AUTO = 0; // 0x0
field public static final int MODE_NIGHT_NO = 1; // 0x1
field public static final int MODE_NIGHT_YES = 2; // 0x2
diff --git a/core/java/android/app/UiModeManager.java b/core/java/android/app/UiModeManager.java
index f79eb04..0a255f7 100644
--- a/core/java/android/app/UiModeManager.java
+++ b/core/java/android/app/UiModeManager.java
@@ -125,15 +125,15 @@
public static final int ENABLE_CAR_MODE_GO_CAR_HOME = 0x0001;
/**
- * Flag for use with {@link #enableCarMode(int)}: do not hold full wake lock
- * while in car mode. By default, when this flag is not set, the system may hold
- * a full wake lock to keep the screen turned on while in car mode.
- * Setting this flag disables such behavior and the screen may be turned off if
- * there is no other user activity and no other full wake lock held.
+ * Flag for use with {@link #enableCarMode(int)}: allow sleep mode while in car mode.
+ * By default, when this flag is not set, the system may hold a full wake lock to keep the
+ * screen turned on and prevent the system from entering sleep mode while in car mode.
+ * Setting this flag disables such behavior and the system may enter sleep mode
+ * if there is no other user activity and no other wake lock held.
* Setting this flag can be relevant for a car dock application that does not require the
* screen kept on.
*/
- public static final int ENABLE_CAR_MODE_NO_WAKE_LOCK = 0x0002;
+ public static final int ENABLE_CAR_MODE_ALLOW_SLEEP = 0x0002;
/**
* Force device into car mode, like it had been placed in the car dock.
diff --git a/services/core/java/com/android/server/UiModeManagerService.java b/services/core/java/com/android/server/UiModeManagerService.java
index 4c6b772..6ab52c6 100644
--- a/services/core/java/com/android/server/UiModeManagerService.java
+++ b/services/core/java/com/android/server/UiModeManagerService.java
@@ -479,7 +479,7 @@
// keep screen on when charging and in car mode
boolean keepScreenOn = mCharging &&
((mCarModeEnabled && mCarModeKeepsScreenOn &&
- (mCarModeEnableFlags & UiModeManager.ENABLE_CAR_MODE_NO_WAKE_LOCK) == 0) ||
+ (mCarModeEnableFlags & UiModeManager.ENABLE_CAR_MODE_ALLOW_SLEEP) == 0) ||
(mCurUiMode == Configuration.UI_MODE_TYPE_DESK && mDeskModeKeepsScreenOn));
if (keepScreenOn != mWakeLock.isHeld()) {
if (keepScreenOn) {