Bug 1061126: Add AVRCP_UID_SIZE to Bluetooth, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 02 Sep 2014 12:46:07 +0200
changeset 226219 518ab7491783ba035ca29c0c80e68a7e87a60af6
parent 226218 001d40ca31bb2ed6a419b2dd895a7a488d61a5f4
child 226220 ad902f1fd574941061127da71d3ee2fafc0df79f
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1061126
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061126: Add AVRCP_UID_SIZE to Bluetooth, r=shuang This constant AVRCP_UID_SIZE replaces the corresponding Bluedroid constant BTRC_UID_SIZE.
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -357,16 +357,20 @@ enum ControlPlayStatus {
   PLAYSTATUS_PLAYING  = 0x01,
   PLAYSTATUS_PAUSED   = 0x02,
   PLAYSTATUS_FWD_SEEK = 0x03,
   PLAYSTATUS_REV_SEEK = 0x04,
   PLAYSTATUS_UNKNOWN,
   PLAYSTATUS_ERROR    = 0xFF,
 };
 
+enum {
+  AVRCP_UID_SIZE = 8
+};
+
 enum BluetoothAvrcpMediaAttribute {
   AVRCP_MEDIA_ATTRIBUTE_TITLE,
   AVRCP_MEDIA_ATTRIBUTE_ARTIST,
   AVRCP_MEDIA_ATTRIBUTE_ALBUM,
   AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM,
   AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS,
   AVRCP_MEDIA_ATTRIBUTE_GENRE,
   AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ -727,18 +727,18 @@ BluetoothA2dpManager::UpdateMetaData(con
 
   // Send track changed and position changed if track num is not the same.
   // See also AVRCP 1.3 Spec 5.4.2
   if (mMediaNumber != aMediaNumber &&
       mTrackChangedNotifyType == AVRCP_NTF_INTERIM) {
     BluetoothAvrcpNotificationParam param;
     // convert to network big endian format
     // since track stores as uint8[8]
-    // 56 = 8 * (BTRC_UID_SIZE -1)
-    for (int i = 0; i < BTRC_UID_SIZE; ++i) {
+    // 56 = 8 * (AVRCP_UID_SIZE -1)
+    for (int i = 0; i < AVRCP_UID_SIZE; ++i) {
       param.mTrack[i] = (aMediaNumber >> (56 - 8 * i));
     }
     mTrackChangedNotifyType = AVRCP_NTF_CHANGED;
     sBtAvrcpInterface->RegisterNotificationRsp(AVRCP_EVENT_TRACK_CHANGE,
                                                AVRCP_NTF_CHANGED,
                                                param, nullptr);
     if (mPlayPosChangedNotifyType == AVRCP_NTF_INTERIM) {
       param.mSongPos = mPosition;
@@ -831,17 +831,17 @@ BluetoothA2dpManager::UpdateRegisterNoti
       // AVRCP 1.4: If no track is selected, we shall return 0xFFFFFFFFFFFFFFFF,
       // otherwise return 0x0 in the INTERRIM response. The expanded text in
       // version 1.4 is to allow for new UID feature. As for AVRCP 1.3, we shall
       // return 0xFFFFFFFF. Since PTS enforces to check this part to comply with
       // the most updated spec.
       mTrackChangedNotifyType = AVRCP_NTF_INTERIM;
       // needs to convert to network big endian format since track stores
       // as uint8[8]. 56 = 8 * (BTRC_UID_SIZE -1).
-      for (int index = 0; index < BTRC_UID_SIZE; ++index) {
+      for (int index = 0; index < AVRCP_UID_SIZE; ++index) {
         // We cannot easily check if a track is selected, so whenever A2DP is
         // streaming, we assume a track is selected.
         if (mSinkState == BluetoothA2dpManager::SinkState::SINK_PLAYING) {
           param.mTrack[index] = 0x0;
         } else {
           param.mTrack[index] = 0xFF;
         }
       }