am b83d9dc3: am dfd80a4e: am 1ff283b8: am 5a7068ee: Merge "SysUI: Correctly compare MediaControllers" into lmp-dev

* commit 'b83d9dc3e1d853d43807375d79d90739e572b938':
  SysUI: Correctly compare MediaControllers
This commit is contained in:
Christoph Studer
2014-09-23 17:48:30 +00:00
committed by Android Git Automerger
2 changed files with 15 additions and 1 deletions

View File

@@ -434,6 +434,14 @@ public final class MediaController {
return mSessionBinder;
}
/**
* @hide
*/
public boolean controlsSameSession(MediaController other) {
if (other == null) return false;
return mSessionBinder.asBinder() == other.getSessionBinder().asBinder();
}
private void addCallbackLocked(Callback cb, Handler handler) {
if (getHandlerForCallbackLocked(cb) != null) {
Log.w(TAG, "Callback is already added, ignoring");

View File

@@ -1758,7 +1758,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
}
if (controller != mMediaController) {
if (!sameSessions(mMediaController, controller)) {
// We have a new media session
if (mMediaController != null) {
@@ -1807,6 +1807,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
updateMediaMetaData(metaDataChanged);
}
private boolean sameSessions(MediaController a, MediaController b) {
if (a == b) return true;
if (a == null) return false;
return a.controlsSameSession(b);
}
/**
* Hide the album artwork that is fading out and release its bitmap.
*/