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

Commit 4947ff46 authored by Bryce Lee's avatar Bryce Lee Committed by Android Git Automerger
Browse files

am 1ae5dc12: am ca7f9a4d: am 5a818e55: Merge "Add config to control going to...

am 1ae5dc12: am ca7f9a4d: am 5a818e55: Merge "Add config to control going to sleep when entering theater mode." into lmp-sprout-dev

* commit '1ae5dc12':
  Add config to control going to sleep when entering theater mode.
parents 8d37f7c1 1ae5dc12
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -473,6 +473,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 -->

+1 −0
Original line number Diff line number Diff line
@@ -1584,6 +1584,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" />
+8 −1
Original line number Diff line number Diff line
@@ -527,6 +527,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;
@@ -984,7 +987,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);
                    }
@@ -1236,6 +1240,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(