Loading src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -267,13 +267,8 @@ public class AddressedMediaPlayer { /* for any item associated with NowPlaying, uid is queueId */ /* for any item associated with NowPlaying, uid is queueId */ if (state != null) qid = state.getActiveQueueItemId(); if (state != null) qid = state.getActiveQueueItemId(); } } if (!requesting && qid == mLastTrackIdSent) { if (DEBUG) Log.d(TAG, "not sending duplicate track changed id " + qid); return false; } track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track)); if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track)); int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED; int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED; if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM; if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM; mMediaInterface.trackChangedRsp(trackChangedNT, track); mMediaInterface.trackChangedRsp(trackChangedNT, track); Loading Loading @@ -488,7 +483,6 @@ public class AddressedMediaPlayer { /* variables to temperorily add attrs */ /* variables to temperorily add attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); ArrayList<Integer> attrTempId = new ArrayList<Integer>(); ArrayList<Integer> attrTempId = new ArrayList<Integer>(); /* check if remote device has requested for attributes */ /* check if remote device has requested for attributes */ Loading src/com/android/bluetooth/avrcp/Avrcp.java +13 −9 Original line number Original line Diff line number Diff line Loading @@ -1583,6 +1583,9 @@ public final class Avrcp { getMediaControllers(); getMediaControllers(); for (android.media.session.MediaController controller : currentControllers) { for (android.media.session.MediaController controller : currentControllers) { if (!newControllers.contains(controller)) { if (!newControllers.contains(controller)) { if (DEBUG) Log.v(TAG, "Removing gone controller for " + controller.getPackageName()); removeMediaController(controller); removeMediaController(controller); } } } } Loading Loading @@ -2215,17 +2218,18 @@ public final class Avrcp { if (mCurrAddrPlayerID == NO_PLAYER_ID) { if (mCurrAddrPlayerID == NO_PLAYER_ID) { getItemAttrRspNative( getItemAttrRspNative( itemAttr.mAddress, AvrcpConstants.RSP_NO_AVBL_PLAY, (byte) 0, null, null); itemAttr.mAddress, AvrcpConstants.RSP_NO_AVBL_PLAY, (byte) 0, null, null); } else { return; } mAddressedMediaPlayer.getItemAttr(itemAttr.mAddress, itemAttr, mMediaController); mAddressedMediaPlayer.getItemAttr(itemAttr.mAddress, itemAttr, mMediaController); return; } } } else { // All other scopes use browsed player if (mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress) != null) { if (mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress) != null) { mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress).getItemAttr(itemAttr); mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress).getItemAttr(itemAttr); } else { } else { Log.e(TAG, "Could not get attributes. mBrowsedMediaPlayer is null"); Log.e(TAG, "Could not get attributes. mBrowsedMediaPlayer is null"); getItemAttrRspNative(itemAttr.mAddress, AvrcpConstants.RSP_INTERNAL_ERR, getItemAttrRspNative( (byte) 0, null, null); itemAttr.mAddress, AvrcpConstants.RSP_INTERNAL_ERR, (byte) 0, null, null); } } } } } Loading Loading
src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -267,13 +267,8 @@ public class AddressedMediaPlayer { /* for any item associated with NowPlaying, uid is queueId */ /* for any item associated with NowPlaying, uid is queueId */ if (state != null) qid = state.getActiveQueueItemId(); if (state != null) qid = state.getActiveQueueItemId(); } } if (!requesting && qid == mLastTrackIdSent) { if (DEBUG) Log.d(TAG, "not sending duplicate track changed id " + qid); return false; } track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); track = ByteBuffer.allocate(AvrcpConstants.UID_SIZE).putLong(qid).array(); if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track)); if (DEBUG) Log.d(TAG, "trackChangedRsp: 0x" + Utils.byteArrayToString(track)); int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED; int trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED; if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM; if (requesting) trackChangedNT = AvrcpConstants.NOTIFICATION_TYPE_INTERIM; mMediaInterface.trackChangedRsp(trackChangedNT, track); mMediaInterface.trackChangedRsp(trackChangedNT, track); Loading Loading @@ -488,7 +483,6 @@ public class AddressedMediaPlayer { /* variables to temperorily add attrs */ /* variables to temperorily add attrs */ ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<String> attrArray = new ArrayList<String>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); ArrayList<Integer> attrId = new ArrayList<Integer>(); ArrayList<Integer> attrTempId = new ArrayList<Integer>(); ArrayList<Integer> attrTempId = new ArrayList<Integer>(); /* check if remote device has requested for attributes */ /* check if remote device has requested for attributes */ Loading
src/com/android/bluetooth/avrcp/Avrcp.java +13 −9 Original line number Original line Diff line number Diff line Loading @@ -1583,6 +1583,9 @@ public final class Avrcp { getMediaControllers(); getMediaControllers(); for (android.media.session.MediaController controller : currentControllers) { for (android.media.session.MediaController controller : currentControllers) { if (!newControllers.contains(controller)) { if (!newControllers.contains(controller)) { if (DEBUG) Log.v(TAG, "Removing gone controller for " + controller.getPackageName()); removeMediaController(controller); removeMediaController(controller); } } } } Loading Loading @@ -2215,17 +2218,18 @@ public final class Avrcp { if (mCurrAddrPlayerID == NO_PLAYER_ID) { if (mCurrAddrPlayerID == NO_PLAYER_ID) { getItemAttrRspNative( getItemAttrRspNative( itemAttr.mAddress, AvrcpConstants.RSP_NO_AVBL_PLAY, (byte) 0, null, null); itemAttr.mAddress, AvrcpConstants.RSP_NO_AVBL_PLAY, (byte) 0, null, null); } else { return; } mAddressedMediaPlayer.getItemAttr(itemAttr.mAddress, itemAttr, mMediaController); mAddressedMediaPlayer.getItemAttr(itemAttr.mAddress, itemAttr, mMediaController); return; } } } else { // All other scopes use browsed player if (mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress) != null) { if (mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress) != null) { mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress).getItemAttr(itemAttr); mAvrcpBrowseManager.getBrowsedMediaPlayer(itemAttr.mAddress).getItemAttr(itemAttr); } else { } else { Log.e(TAG, "Could not get attributes. mBrowsedMediaPlayer is null"); Log.e(TAG, "Could not get attributes. mBrowsedMediaPlayer is null"); getItemAttrRspNative(itemAttr.mAddress, AvrcpConstants.RSP_INTERNAL_ERR, getItemAttrRspNative( (byte) 0, null, null); itemAttr.mAddress, AvrcpConstants.RSP_INTERNAL_ERR, (byte) 0, null, null); } } } } } Loading