Merge "Add config to control going to sleep when entering theater mode." into lmp-sprout-dev
This commit is contained in:
@@ -472,6 +472,8 @@
|
||||
<bool name="config_allowTheaterModeWakeFromDock">false</bool>
|
||||
<!-- If this is true, allow wake from theater mode from window layout flag. -->
|
||||
<bool name="config_allowTheaterModeWakeFromWindowLayout">false</bool>
|
||||
<!-- If this is true, go to sleep when theater mode is enabled from button press -->
|
||||
<bool name="config_goToSleepOnButtonPressTheaterMode">true</bool>
|
||||
|
||||
<!-- Auto-rotation behavior -->
|
||||
|
||||
|
||||
@@ -1582,6 +1582,7 @@
|
||||
<java-symbol type="bool" name="config_allowTheaterModeWakeFromLidSwitch" />
|
||||
<java-symbol type="bool" name="config_allowTheaterModeWakeFromDock" />
|
||||
<java-symbol type="bool" name="config_allowTheaterModeWakeFromWindowLayout" />
|
||||
<java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" />
|
||||
<java-symbol type="bool" name="config_wifi_background_scan_support" />
|
||||
<java-symbol type="bool" name="config_wifi_dual_band_support" />
|
||||
<java-symbol type="bool" name="config_wimaxEnabled" />
|
||||
|
||||
@@ -526,6 +526,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
private boolean mAllowTheaterModeWakeFromLidSwitch;
|
||||
private boolean mAllowTheaterModeWakeFromWakeGesture;
|
||||
|
||||
// Whether to go to sleep entering theater mode from power button
|
||||
private boolean mGoToSleepOnButtonPressTheaterMode;
|
||||
|
||||
// Screenshot trigger states
|
||||
// Time to volume and power must be pressed within this interval of each other.
|
||||
private static final long SCREENSHOT_CHORD_DEBOUNCE_DELAY_MILLIS = 150;
|
||||
@@ -983,7 +986,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
Slog.i(TAG, "Toggling theater mode on.");
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.THEATER_MODE_ON, 1);
|
||||
if (interactive) {
|
||||
|
||||
if (mGoToSleepOnButtonPressTheaterMode && interactive) {
|
||||
mPowerManager.goToSleep(eventTime,
|
||||
PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON, 0);
|
||||
}
|
||||
@@ -1235,6 +1239,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mAllowTheaterModeWakeFromWakeGesture = mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_allowTheaterModeWakeFromGesture);
|
||||
|
||||
mGoToSleepOnButtonPressTheaterMode = mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_goToSleepOnButtonPressTheaterMode);
|
||||
|
||||
mShortPressOnPowerBehavior = mContext.getResources().getInteger(
|
||||
com.android.internal.R.integer.config_shortPressOnPowerBehavior);
|
||||
mLongPressOnPowerBehavior = mContext.getResources().getInteger(
|
||||
|
||||
Reference in New Issue
Block a user