Bug 1148311 - Handle AVRCP app settings notification response. r=tzimmermann, a=bajaj
authorShawn Huang <shuang@mozilla.com>
Mon, 30 Mar 2015 05:46:00 -0400
changeset 238133 7e7accd7a911b67c54987ff8a7749bd5e1c406cf
parent 238132 59d0b3b6665e2f208f6f1bf8e33a6f1244db8059
child 238134 98e34ab531a2439bb7c14edec8e76b9d4b77030d
push id488
push userryanvm@gmail.com
push dateMon, 13 Apr 2015 20:29:57 +0000
treeherdermozilla-b2g37_v2_2@85ea1be9ac7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstzimmermann, bajaj
bugs1148311
milestone37.0
Bug 1148311 - Handle AVRCP app settings notification response. r=tzimmermann, a=bajaj
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
dom/bluetooth/bluedroid/BluetoothA2dpManager.h
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -401,16 +401,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
@@ -154,13 +154,14 @@ private:
    * status.
    * mPlayStatusChangedNotifType, mTrackChangedNotifType,
    * mPlayPosChangedNotifType represents current RegisterNotification
    * notification type.
    */
   BluetoothAvrcpNotification mPlayStatusChangedNotifyType;
   BluetoothAvrcpNotification mTrackChangedNotifyType;
   BluetoothAvrcpNotification mPlayPosChangedNotifyType;
+  BluetoothAvrcpNotification mAppSettingsChangedNotifyType;
 };
 
 END_BLUETOOTH_NAMESPACE
 
 #endif