summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaurav Asati <gasati@codeaurora.org>2014-12-24 11:07:41 +0530
committerArne Coucheron <arco68@gmail.com>2015-01-22 00:51:42 +0100
commita182008a0e3c6f85eef4e4b7d09f5bb94a2a9c56 (patch)
tree53a25d725120a9459b19d9ed79b905aba77683a4
parent35c6e72e87a4866c628b53f810d31904d9bf66d6 (diff)
downloadandroid_packages_apps_Bluetooth-a182008a0e3c6f85eef4e4b7d09f5bb94a2a9c56.tar.gz
android_packages_apps_Bluetooth-a182008a0e3c6f85eef4e4b7d09f5bb94a2a9c56.tar.bz2
android_packages_apps_Bluetooth-a182008a0e3c6f85eef4e4b7d09f5bb94a2a9c56.zip
Bluetooth: Porper update of the tracknumber and initialize with proper value.
- Proper update of the tracknumber. - initialize mCurrentPosMs with 0xFFFFFFFF. - when music app does not send current track position 0xFFFFFFFF should be send when requested by remote. Change-Id: Ie424a8de27cd1eca8bed332295977a3f952a6d2a CRs-Fixed: 775209
-rw-r--r--src/com/android/bluetooth/avrcp/Avrcp.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/bluetooth/avrcp/Avrcp.java b/src/com/android/bluetooth/avrcp/Avrcp.java
index e9fe70a43..f7820af1d 100644
--- a/src/com/android/bluetooth/avrcp/Avrcp.java
+++ b/src/com/android/bluetooth/avrcp/Avrcp.java
@@ -327,7 +327,7 @@ public final class Avrcp {
mAvailablePlayersChangedNT = NOTIFICATION_TYPE_CHANGED;
mNowPlayingContentChangedNT = NOTIFICATION_TYPE_CHANGED;
mTrackNumber = -1L;
- mCurrentPosMs = 0L;
+ mCurrentPosMs = -1L;
mPlayStartTimeMs = -1L;
mSongLengthMs = 0L;
mPlaybackIntervalMs = 0L;
@@ -676,8 +676,10 @@ public final class Avrcp {
}
mMediaUri = uri;
if (handler != null) {
+ // Don't send the complete path to CK as few gets confused by that
+ // Send only the name of the root folder
handler.obtainMessage(MSG_UPDATE_BROWSED_PLAYER_FOLDER, NUM_ROOT_ELEMENTS,
- SplitPath.length, SplitPath).sendToTarget();
+ 1, SplitPath).sendToTarget();
}
} else {
handler.obtainMessage(MSG_UPDATE_BROWSED_PLAYER_FOLDER, 0, 0, null)
@@ -1404,7 +1406,7 @@ public final class Avrcp {
trackTitle = null;
albumTitle = null;
genre = null;
- tracknum = 0;
+ tracknum = -1L;
}
public String toString() {
@@ -3143,11 +3145,9 @@ public final class Avrcp {
long TrackNumberRsp = -1L;
if(DEBUG) Log.v(TAG,"mCurrentPlayState" + mCurrentPlayState );
- /*As per spec 6.7.2 Register Notification
- If no track is currently selected, then return
- 0xFFFFFFFFFFFFFFFF in the interim response */
- if (mCurrentPlayState == RemoteControlClient.PLAYSTATE_PLAYING)
+
TrackNumberRsp = mMetadata.tracknum ;
+
/* track is stored in big endian format */
for (int i = 0; i < TRACK_ID_SIZE; ++i) {
track[i] = (byte) (TrackNumberRsp >> (56 - 8 * i));