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

Commit 1a693182 authored by Jeff Brown's avatar Jeff Brown
Browse files

Handle EXTRA_DOCK_STATE_LE_DESK and HE_DESK.

Bug: 5569662

Change-Id: Ib8cb9fb68a1a2d3520f34f7fbf6f002dfb91809d
parent 650a3e88
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -493,7 +493,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return true;
        }
        if ((mCarDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_CAR) ||
                (mDeskDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_DESK)) {
                (mDeskDockEnablesAccelerometer && (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
                        || mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK
                        || mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK))) {
            // enable accelerometer if we are docked in a dock that enables accelerometer
            // orientation management,
            return true;
@@ -3137,7 +3139,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                // enable 180 degree rotation while docked.
                preferredRotation = mCarDockEnablesAccelerometer
                        ? sensorRotation : mCarDockRotation;
            } else if (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
            } else if ((mDockMode == Intent.EXTRA_DOCK_STATE_DESK
                    || mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK
                    || mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK)
                    && (mDeskDockEnablesAccelerometer || mDeskDockRotation >= 0)) {
                // Ignore sensor when in desk dock unless explicitly enabled.
                // This case can override the behavior of NOSENSOR, and can also
+3 −1
Original line number Diff line number Diff line
@@ -82,7 +82,9 @@ class DockObserver extends UEventObserver {
                        // Don't force screen on when undocking from the desk dock.
                        // The change in power state will do this anyway.
                        // FIXME - we should be configurable.
                        if (mPreviousDockState != Intent.EXTRA_DOCK_STATE_DESK ||
                        if ((mPreviousDockState != Intent.EXTRA_DOCK_STATE_DESK
                                && mPreviousDockState != Intent.EXTRA_DOCK_STATE_LE_DESK
                                && mPreviousDockState != Intent.EXTRA_DOCK_STATE_HE_DESK) ||
                                mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
                            mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),
                                    false, true);