Loading android/app/src/com/android/bluetooth/avrcp/Avrcp.java +9 −23 Original line number Diff line number Diff line Loading @@ -946,23 +946,20 @@ public final class Avrcp { private void updateCurrentMediaState() { MediaAttributes currentAttributes = mMediaAttributes; PlaybackState newState = mCurrentPlayState; PlaybackState newState = null; if (mMediaController == null) { // Use A2DP state if we don't have a MediaControlller boolean isPlaying = (mA2dpState == BluetoothA2dp.STATE_PLAYING) && mAudioManager.isMusicActive(); if (isPlaying != isPlayingState(mCurrentPlayState)) { /* if a2dp is streaming, check to make sure music is active */ PlaybackState.Builder builder = new PlaybackState.Builder(); if (isPlaying) { builder.setState(PlaybackState.STATE_PLAYING, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f); builder.setState( PlaybackState.STATE_PLAYING, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f); } else { builder.setState(PlaybackState.STATE_PAUSED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f); builder.setState( PlaybackState.STATE_PAUSED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f); } newState = builder.build(); } mMediaAttributes = new MediaAttributes(null); } else { newState = mMediaController.getPlaybackState(); Loading Loading @@ -1570,17 +1567,6 @@ public final class Avrcp { playersChanged = true; } List<android.media.session.MediaController> currentControllers = getMediaControllers(); for (android.media.session.MediaController controller : currentControllers) { if (!newControllers.contains(controller)) { if (DEBUG) Log.v(TAG, "Removing gone controller for " + controller.getPackageName()); removeMediaController(controller); } } if (playersChanged) { mHandler.sendEmptyMessage(MSG_AVAILABLE_PLAYERS_CHANGED_RSP); if (newControllers.size() > 0 && getAddressedPlayerInfo() == null) { Loading Loading
android/app/src/com/android/bluetooth/avrcp/Avrcp.java +9 −23 Original line number Diff line number Diff line Loading @@ -946,23 +946,20 @@ public final class Avrcp { private void updateCurrentMediaState() { MediaAttributes currentAttributes = mMediaAttributes; PlaybackState newState = mCurrentPlayState; PlaybackState newState = null; if (mMediaController == null) { // Use A2DP state if we don't have a MediaControlller boolean isPlaying = (mA2dpState == BluetoothA2dp.STATE_PLAYING) && mAudioManager.isMusicActive(); if (isPlaying != isPlayingState(mCurrentPlayState)) { /* if a2dp is streaming, check to make sure music is active */ PlaybackState.Builder builder = new PlaybackState.Builder(); if (isPlaying) { builder.setState(PlaybackState.STATE_PLAYING, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f); builder.setState( PlaybackState.STATE_PLAYING, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f); } else { builder.setState(PlaybackState.STATE_PAUSED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f); builder.setState( PlaybackState.STATE_PAUSED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f); } newState = builder.build(); } mMediaAttributes = new MediaAttributes(null); } else { newState = mMediaController.getPlaybackState(); Loading Loading @@ -1570,17 +1567,6 @@ public final class Avrcp { playersChanged = true; } List<android.media.session.MediaController> currentControllers = getMediaControllers(); for (android.media.session.MediaController controller : currentControllers) { if (!newControllers.contains(controller)) { if (DEBUG) Log.v(TAG, "Removing gone controller for " + controller.getPackageName()); removeMediaController(controller); } } if (playersChanged) { mHandler.sendEmptyMessage(MSG_AVAILABLE_PLAYERS_CHANGED_RSP); if (newControllers.size() > 0 && getAddressedPlayerInfo() == null) { Loading