When watch is docked, home key press should launch dock home.

Bug: 15575717
Change-Id: Ib3fbe3ed0380378b0162901bfeebe3c218c4d568
This commit is contained in:
Jeff Brown
2014-06-12 19:19:15 -07:00
parent 55c11af78a
commit 4f5fa285a8

View File

@@ -297,6 +297,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean mSystemReady;
boolean mSystemBooted;
boolean mHdmiPlugged;
IUiModeManager mUiModeManager;
int mUiMode;
int mDockMode = Intent.EXTRA_DOCK_STATE_UNDOCKED;
int mLidOpenRotation;
@@ -4756,6 +4757,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null);
mKeyguardDelegate.onSystemReady();
updateUiMode();
synchronized (mLock) {
updateOrientationListenerLp();
mSystemReady = true;
@@ -4932,6 +4934,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
void updateUiMode() {
if (mUiModeManager == null) {
mUiModeManager = IUiModeManager.Stub.asInterface(
ServiceManager.getService(Context.UI_MODE_SERVICE));
}
try {
mUiMode = mUiModeManager.getCurrentModeType();
} catch (RemoteException e) {
}
}
void updateRotation(boolean alwaysSendConfiguration) {
try {
//set orientation on WindowManager
@@ -4977,6 +4990,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (ENABLE_DESK_DOCK_HOME_CAPTURE) {
intent = mDeskDockIntent;
}
} else if (mUiMode == Configuration.UI_MODE_TYPE_WATCH
&& (mDockMode == Intent.EXTRA_DOCK_STATE_DESK
|| mDockMode == Intent.EXTRA_DOCK_STATE_HE_DESK
|| mDockMode == Intent.EXTRA_DOCK_STATE_LE_DESK)) {
// Always launch dock home from home when watch is docked, if it exists.
intent = mDeskDockIntent;
}
if (intent == null) {