diff options
| author | Jeff Brown <jeffbrown@google.com> | 2014-06-13 03:04:25 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-13 03:04:25 +0000 |
| commit | 1a073a8f550695342e8e3902d2223fd237941e95 (patch) | |
| tree | 55e0c78ddc4cd0db462d522295d68532d6455b63 | |
| parent | 4849aa86b1f26c12d036f32fa5b1413cecd77760 (diff) | |
| parent | 926e1f01a5f2366c5d0eeab358822ba1d138d980 (diff) | |
| download | frameworks_base-1a073a8f550695342e8e3902d2223fd237941e95.zip frameworks_base-1a073a8f550695342e8e3902d2223fd237941e95.tar.gz frameworks_base-1a073a8f550695342e8e3902d2223fd237941e95.tar.bz2 | |
am 926e1f01: Merge "When watch is docked, home key press should launch dock home." into klp-modular-dev
* commit '926e1f01a5f2366c5d0eeab358822ba1d138d980':
When watch is docked, home key press should launch dock home.
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 79fad63..fad4396 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -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) { |
