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

Commit 2c1c74af authored by keunyoung's avatar keunyoung Committed by Android (Google) Code Review
Browse files

Merge "rename UiModeManager.ENABLE_CAR_MODE_NO_WAKE_LOCK to...

Merge "rename UiModeManager.ENABLE_CAR_MODE_NO_WAKE_LOCK to ENABLE_CAR_MODE_ALLOW_SLEEP" into lmp-dev
parents 396181b0 c093bf26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5239,7 +5239,7 @@ package android.app {
    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
+6 −6
Original line number Diff line number Diff line
@@ -125,15 +125,15 @@ public class UiModeManager {
    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.
+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ final class UiModeManagerService extends SystemService {
        // 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) {