Merge "Always bind to new media source, clear session callback" into qt-qpr1-dev
diff --git a/service/src/com/android/car/CarMediaService.java b/service/src/com/android/car/CarMediaService.java
index 665643a..0bec4e8 100644
--- a/service/src/com/android/car/CarMediaService.java
+++ b/service/src/com/android/car/CarMediaService.java
@@ -519,6 +519,11 @@
return;
}
+ // Clear playback state callback so we preserve the state before stopping
+ if (mActiveUserMediaController != null) {
+ mActiveUserMediaController.unregisterCallback(mMediaControllerCallback);
+ mActiveUserMediaController = null;
+ }
stop();
mPreviousMediaComponent = mPrimaryMediaComponent;
@@ -535,9 +540,9 @@
}
notifyListeners();
- if (shouldStartPlayback(mPlayOnMediaSourceChangedConfig)) {
- startMediaConnectorService(true, new UserHandle(mCurrentUser));
- }
+
+ startMediaConnectorService(shouldStartPlayback(mPlayOnMediaSourceChangedConfig),
+ new UserHandle(mCurrentUser));
}
private void notifyListeners() {