Merge "Handle EXTRA_DOCK_STATE_LE_DESK and HE_DESK. Bug: 5569662" into ics-mr1

This commit is contained in:
Jeff Brown
2011-11-08 17:22:06 -08:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 3 deletions

View File

@ -493,7 +493,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return true; return true;
} }
if ((mCarDockEnablesAccelerometer && mDockMode == Intent.EXTRA_DOCK_STATE_CAR) || 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 // enable accelerometer if we are docked in a dock that enables accelerometer
// orientation management, // orientation management,
return true; return true;
@ -3137,7 +3139,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// enable 180 degree rotation while docked. // enable 180 degree rotation while docked.
preferredRotation = mCarDockEnablesAccelerometer preferredRotation = mCarDockEnablesAccelerometer
? sensorRotation : mCarDockRotation; ? 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)) { && (mDeskDockEnablesAccelerometer || mDeskDockRotation >= 0)) {
// Ignore sensor when in desk dock unless explicitly enabled. // Ignore sensor when in desk dock unless explicitly enabled.
// This case can override the behavior of NOSENSOR, and can also // This case can override the behavior of NOSENSOR, and can also

View File

@ -82,7 +82,9 @@ class DockObserver extends UEventObserver {
// Don't force screen on when undocking from the desk dock. // Don't force screen on when undocking from the desk dock.
// The change in power state will do this anyway. // The change in power state will do this anyway.
// FIXME - we should be configurable. // 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) { mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(), mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(),
false, true); false, true);