Bug 1102703 - Porting bluetooth interface of android lollipop (a2dp). r=shawnjohnjr
☠☠ backed out by b4926227268f ☠ ☠
authorBruce Sun <brsun@mozilla.com>
Thu, 08 Jan 2015 11:47:42 +0800
changeset 248497 ece26b235282103462be87d39e3bdbc973c06d32
parent 248496 9f067e4973ebec2447d6caa7dadea196c5d2ca39
child 248498 ff47d1b9e86cd3cb2e56c5ab36011161e65de5b3
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshawnjohnjr
bugs1102703
milestone37.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 1102703 - Porting bluetooth interface of android lollipop (a2dp). r=shawnjohnjr
dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
--- a/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
@@ -93,16 +93,26 @@ struct BluetoothA2dpHALCallback
 
   static void
   AudioState(btav_audio_state_t aState, bt_bdaddr_t* aBdAddr)
   {
     AudioStateNotification::Dispatch(
       &BluetoothA2dpNotificationHandler::AudioStateNotification,
       aState, aBdAddr);
   }
+
+#if ANDROID_VERSION >= 21
+  static void
+  AudioConfig(bt_bdaddr_t *aBdAddr, uint32_t aSampleRate, uint8_t aChannelCount)
+  {
+    AudioConfigNotification::Dispatch(
+      &BluetoothA2dpNotificationHandler::AudioConfigNotification,
+      aBdAddr, aSampleRate, aChannelCount);
+  }
+#endif
 };
 
 // Interface
 //
 
 BluetoothA2dpHALInterface::BluetoothA2dpHALInterface(
   const btav_interface_t* aInterface)
 : mInterface(aInterface)
@@ -116,17 +126,20 @@ BluetoothA2dpHALInterface::~BluetoothA2d
 void
 BluetoothA2dpHALInterface::Init(
   BluetoothA2dpNotificationHandler* aNotificationHandler,
   BluetoothA2dpResultHandler* aRes)
 {
   static btav_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothA2dpHALCallback::ConnectionState,
-    BluetoothA2dpHALCallback::AudioState
+    BluetoothA2dpHALCallback::AudioState,
+#if ANDROID_VERSION >= 21
+    BluetoothA2dpHALCallback::AudioConfig
+#endif
   };
 
   sA2dpNotificationHandler = aNotificationHandler;
 
   bt_status_t status = mInterface->init(&sCallbacks);
 
   if (aRes) {
     DispatchBluetoothA2dpHALResult(aRes,