diff options
author | Jim Miller <jaggies@google.com> | 2013-05-31 21:41:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-05-31 21:41:34 +0000 |
commit | 00d4c94625226ab325def94e9b82074f39572b43 (patch) | |
tree | 9619e2f172b3b1639a5155a8f0e6caf953824a47 /policy | |
parent | 0dc7891ccb9698aa5d1f8b40aff797184c0544aa (diff) | |
parent | dfb57cdcfc6a1fd48395c13af98ecc2722fd5254 (diff) | |
download | frameworks_base-00d4c94625226ab325def94e9b82074f39572b43.zip frameworks_base-00d4c94625226ab325def94e9b82074f39572b43.tar.gz frameworks_base-00d4c94625226ab325def94e9b82074f39572b43.tar.bz2 |
Merge "Fix keyguard issue where an incoming SMS would switch widget" into jb-mr2-dev
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index c470870..c3077c7 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -118,7 +118,6 @@ public class KeyguardHostView extends KeyguardViewBase { private KeyguardMultiUserSelectorView mKeyguardMultiUserSelectorView; - protected int mPlaybackState; protected int mClientGeneration; /*package*/ interface UserSwitcherCallback { @@ -205,10 +204,9 @@ public class KeyguardHostView extends KeyguardViewBase { .getCachedDisplayClientState(); mTransportState = (dcs.clearing ? TRANSPORT_GONE : (isMusicPlaying(dcs.playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE)); - mPlaybackState = dcs.playbackState; if (DEBUG) Log.v(TAG, "Initial transport state: " - + mTransportState + ", pbstate=" + mPlaybackState); + + mTransportState + ", pbstate=" + dcs.playbackState); } private void cleanupAppWidgetIds() { @@ -274,18 +272,27 @@ public class KeyguardHostView extends KeyguardViewBase { Log.v(TAG, (clearing ? "hide" : "show") + " transport, gen:" + clientGeneration); } mClientGeneration = clientGeneration; - mTransportState = (clearing ? TRANSPORT_GONE : TRANSPORT_INVISIBLE); - KeyguardHostView.this.post(mSwitchPageRunnable); + final int newState = (clearing ? TRANSPORT_GONE + : (mTransportState == TRANSPORT_VISIBLE ? + TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE)); + if (newState != mTransportState) { + mTransportState = newState; + if (DEBUGXPORT) Log.v(TAG, "update widget: transport state changed"); + KeyguardHostView.this.post(mSwitchPageRunnable); + } } @Override public void onMusicPlaybackStateChanged(int playbackState, long eventTime) { - mPlaybackState = playbackState; if (DEBUGXPORT) Log.v(TAG, "music state changed: " + playbackState); if (mTransportState != TRANSPORT_GONE) { - mTransportState = (isMusicPlaying(mPlaybackState) ? + final int newState = (isMusicPlaying(playbackState) ? TRANSPORT_VISIBLE : TRANSPORT_INVISIBLE); + if (newState != mTransportState) { + mTransportState = newState; + if (DEBUGXPORT) Log.v(TAG, "update widget: play state changed"); + KeyguardHostView.this.post(mSwitchPageRunnable); + } } - KeyguardHostView.this.post(mSwitchPageRunnable); } }; |