OSDN Git Service

Bluetooth streaming should wait for AVRCP to start.
authorSanket Agarwal <sanketa@google.com>
Thu, 7 Apr 2016 18:56:26 +0000 (11:56 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 7 Apr 2016 23:39:46 +0000 (23:39 +0000)
Currently we are waiting for A2DP to come up before we can start
streaming. This is not ideal since unless AVRCP comes up we cannot show
the UI reliably. That said, for compatibility with devices only having
A2DP we will need to modify this code. For now the A2DP SNK is only
supposed to work with AVRCP TG implementation on the remote.

Bug: b/27744764
Change-Id: I972cf94f5b276d9b0e08315175ae605ccfe6a423

src/com/android/bluetooth/a2dpsink/mbs/A2dpMediaBrowserService.java

index 0f7478e..7ee0276 100644 (file)
@@ -16,7 +16,6 @@
 
 package com.android.bluetooth.a2dpsink.mbs;
 
-import android.bluetooth.BluetoothA2dpSink;
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothAvrcpController;
 import android.bluetooth.BluetoothDevice;
@@ -132,7 +131,7 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
         mAdapter.getProfileProxy(this, mServiceListener, BluetoothProfile.AVRCP_CONTROLLER);
 
         IntentFilter filter = new IntentFilter();
-        filter.addAction(BluetoothA2dpSink.ACTION_CONNECTION_STATE_CHANGED);
+        filter.addAction(BluetoothAvrcpController.ACTION_CONNECTION_STATE_CHANGED);
         filter.addAction(BluetoothAvrcpController.ACTION_TRACK_EVENT);
         registerReceiver(mBtReceiver, filter);
     }
@@ -258,7 +257,7 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
                     (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
             int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1);
 
-            if (BluetoothA2dpSink.ACTION_CONNECTION_STATE_CHANGED.equals(action)) {
+            if (BluetoothAvrcpController.ACTION_CONNECTION_STATE_CHANGED.equals(action)) {
                 Log.d(TAG, "handleConnectionStateChange: newState="
                         + state + " btDev=" + btDev);