Bug 1102703: (5/10) Porting bluetooth interface of android lollipop (a2dp) r=shawnjohnjr
authorBruce Sun <brsun@mozilla.com>
Fri, 09 Jan 2015 13:37:05 +0800
changeset 248815 c2b2ab12dfdd5ba36e401bca83a8e872d4531f76
parent 248814 4ab94ffcee0c68f672b62ab0513eff7d45e6a07b
child 248816 e8a635821772f9c9e074915b07a1fdc794cd09fb
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: (5/10) 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,