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

Commit e9adc317 authored by William Leshner's avatar William Leshner Committed by Android (Google) Code Review
Browse files

Merge "Provide a way to keep dreaming when undocking." into tm-qpr-dev

parents 81b40bae bef02552
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -550,6 +550,9 @@
    <!-- If this is true, long press on power button will be available from the non-interactive state -->
    <bool name="config_supportLongPressPowerWhenNonInteractive">false</bool>

    <!-- If this is true, then keep dreaming when undocking. -->
    <bool name="config_keepDreamingWhenUndocking">false</bool>

    <!-- Auto-rotation behavior -->

    <!-- If true, enables auto-rotation features using the accelerometer.
+1 −0
Original line number Diff line number Diff line
@@ -1978,6 +1978,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_keepDreamingWhenUndocking" />
  <java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" />
  <java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" />
  <java-symbol type="bool" name="config_wimaxEnabled" />
+14 −4
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ final class DockObserver extends SystemService {

    private boolean mUpdatesStopped;

    private final boolean mKeepDreamingWhenUndocking;
    private final boolean mAllowTheaterModeWakeFromDock;

    private final List<ExtconStateConfig> mExtconStateConfigs;
@@ -164,6 +165,8 @@ final class DockObserver extends SystemService {
        mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
        mAllowTheaterModeWakeFromDock = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowTheaterModeWakeFromDock);
        mKeepDreamingWhenUndocking = context.getResources().getBoolean(
                com.android.internal.R.bool.config_keepDreamingWhenUndocking);

        mExtconStateConfigs = loadExtconStateConfigs(context);

@@ -216,10 +219,8 @@ final class DockObserver extends SystemService {
        if (newState != mReportedDockState) {
            mReportedDockState = newState;
            if (mSystemReady) {
                // Wake up immediately when docked or undocked except in theater mode.
                if (mAllowTheaterModeWakeFromDock
                        || Settings.Global.getInt(getContext().getContentResolver(),
                            Settings.Global.THEATER_MODE_ON, 0) == 0) {
                // Wake up immediately when docked or undocked unless prohibited from doing so.
                if (allowWakeFromDock()) {
                    mPowerManager.wakeUp(SystemClock.uptimeMillis(),
                            "android.server:DOCK");
                }
@@ -228,6 +229,15 @@ final class DockObserver extends SystemService {
        }
    }

    private boolean allowWakeFromDock() {
        if (mKeepDreamingWhenUndocking) {
            return false;
        }
        return (mAllowTheaterModeWakeFromDock
                || Settings.Global.getInt(getContext().getContentResolver(),
                Settings.Global.THEATER_MODE_ON, 0) == 0);
    }

    private void updateLocked() {
        mWakeLock.acquire();
        mHandler.sendEmptyMessage(MSG_DOCK_STATE_CHANGED);
+1 −1
Original line number Diff line number Diff line
@@ -1487,7 +1487,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        a.colorMode = ActivityInfo.COLOR_MODE_DEFAULT;
        a.flags |= ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS;
        a.resizeMode = RESIZE_MODE_UNRESIZEABLE;
        a.configChanges = ActivityInfo.CONFIG_ORIENTATION;
        a.configChanges = 0xffffffff;

        final ActivityOptions options = ActivityOptions.makeBasic();
        options.setLaunchActivityType(ACTIVITY_TYPE_DREAM);