Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 443fa4e1 authored by Sanket Agarwal's avatar Sanket Agarwal Committed by Andre Eisenbach
Browse files

Bluetooth streaming should wait for AVRCP to start.

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
parent 6d9825fd
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);