From 46e6f7feba99a2cd03e0e069ba7f7155d31163c9 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 2 Sep 2014 12:46:07 +0200 Subject: [PATCH] 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 | 4 ++++ dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dom/bluetooth/BluetoothCommon.h b/dom/bluetooth/BluetoothCommon.h index 9667957694c7..037a9f9ef302 100644 --- a/dom/bluetooth/BluetoothCommon.h +++ b/dom/bluetooth/BluetoothCommon.h @@ -362,6 +362,10 @@ enum ControlPlayStatus { PLAYSTATUS_ERROR = 0xFF, }; +enum { + AVRCP_UID_SIZE = 8 +}; + enum BluetoothAvrcpMediaAttribute { AVRCP_MEDIA_ATTRIBUTE_TITLE, AVRCP_MEDIA_ATTRIBUTE_ARTIST, diff --git a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp index 38dc7e0aab6b..cfb8be6b6e46 100644 --- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp @@ -732,8 +732,8 @@ BluetoothA2dpManager::UpdateMetaData(const nsAString& aTitle, 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; @@ -836,7 +836,7 @@ BluetoothA2dpManager::UpdateRegisterNotification(BluetoothAvrcpEvent aEvent, 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) {