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

Commit 1d069925 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Do not force screen on when undocking from the desk dock.



The fact that the phone is losing power will do this anyway,
and this fixes (or works around) bug b/2250075
(Desk dock clock app sometimes doesn't exit when removing a sleeping droid from the dock)

Change-Id: I7b8b6cfb44ca16d2d9eb67589cb9d9a108a8de82
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 9d9dda53
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -111,8 +111,17 @@ class DockObserver extends UEventObserver {
            try {
                int newState = Integer.parseInt(event.get("SWITCH_STATE"));
                if (newState != mDockState) {
                    int oldState = mDockState;
                    mDockState = newState;
                    if (mSystemReady) {
                        // 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 (oldState != Intent.EXTRA_DOCK_STATE_DESK ||
                                newState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
                            mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),
                                    false, true);
                        }
                        update();
                    }
                }
@@ -166,7 +175,6 @@ class DockObserver extends UEventObserver {
                    return;
                }
                // Pack up the values and broadcast them to everyone
                mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
                Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
                intent.putExtra(Intent.EXTRA_DOCK_STATE, mDockState);