Bug 1148311 - Handle AVRCP app settings notification response. r=tzimmermann
authorShawn Huang <shuang@mozilla.com>
Mon, 30 Mar 2015 05:46:00 -0400
changeset 236749 7d0fbe8f67c26a039773c145f8ca13c3fc8975ee
parent 236748 2229f27ee4ba205cb4c927aabd56c8f46f21a80e
child 236750 0a014b0fc9448aa890e9bd757361c6d8e2a73a2e
push id14840
push userryanvm@gmail.com
push dateTue, 31 Mar 2015 15:48:23 +0000
treeherderb2g-inbound@0a014b0fc944 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstzimmermann
bugs1148311
milestone40.0a1
Bug 1148311 - Handle AVRCP app settings notification response. r=tzimmermann
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
dom/bluetooth/bluedroid/BluetoothA2dpManager.h
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -428,16 +428,29 @@ enum BluetoothAvrcpMediaAttribute {
 
 enum BluetoothAvrcpPlayerAttribute {
   AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
   AVRCP_PLAYER_ATTRIBUTE_REPEAT,
   AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
   AVRCP_PLAYER_ATTRIBUTE_SCAN
 };
 
+enum BluetoothAvrcpPlayerRepeatValue {
+  AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
+  AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
+  AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
+  AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04,
+};
+
+enum BluetoothAvrcpPlayerShuffleValue {
+  AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
+  AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
+  AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03,
+};
+
 enum BluetoothAvrcpStatus {
   AVRCP_STATUS_BAD_COMMAND,
   AVRCP_STATUS_BAD_PARAMETER,
   AVRCP_STATUS_NOT_FOUND,
   AVRCP_STATUS_INTERNAL_ERROR,
   AVRCP_STATUS_SUCCESS
 };
 
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ -921,16 +921,24 @@ BluetoothA2dpManager::UpdateRegisterNoti
       mPlayPosChangedNotifyType = AVRCP_NTF_INTERIM;
       if (mSinkState == BluetoothA2dpManager::SinkState::SINK_PLAYING) {
         param.mSongPos = mPosition;
       } else {
         param.mSongPos = 0xFFFFFFFF;
       }
       mPlaybackInterval = aParam;
       break;
+    case AVRCP_EVENT_APP_SETTINGS_CHANGED:
+      mAppSettingsChangedNotifyType = AVRCP_NTF_INTERIM;
+      param.mNumAttr = 2;
+      param.mIds[0] = AVRCP_PLAYER_ATTRIBUTE_REPEAT;
+      param.mValues[0] = AVRCP_PLAYER_VAL_OFF_REPEAT;
+      param.mIds[1] = AVRCP_PLAYER_ATTRIBUTE_SHUFFLE;
+      param.mValues[1] = AVRCP_PLAYER_VAL_OFF_SHUFFLE;
+      break;
     default:
       break;
   }
 
   sBtAvrcpInterface->RegisterNotificationRsp(aEvent, AVRCP_NTF_INTERIM,
                                              param, nullptr);
 }
 
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.h
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.h
@@ -156,13 +156,14 @@ private:
    * status.
    * mPlayStatusChangedNotifType, mTrackChangedNotifType,
    * mPlayPosChangedNotifType represents current RegisterNotification
    * notification type.
    */
   BluetoothAvrcpNotification mPlayStatusChangedNotifyType;
   BluetoothAvrcpNotification mTrackChangedNotifyType;
   BluetoothAvrcpNotification mPlayPosChangedNotifyType;
+  BluetoothAvrcpNotification mAppSettingsChangedNotifyType;
 };
 
 END_BLUETOOTH_NAMESPACE
 
 #endif