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

Commit 228d4026 authored by kai's avatar kai
Browse files

AVRCP controller browse

onConnect and disconnect update the player list

Bug: 62105073
Test: 1 disconnect bluetooth, check the player list
      2 connect bluetooth, check the player list, kill bluetooth audio
      app and repeat

Change-Id: I27ea0eaebd90bddc952fc6445697796897d7cf07
Merged-In: I5a0ed5a3d8f02911d2077d9d99b427eeaddf4dbd
(cherry picked from commit 01bd404e)
parent f93b2a4e
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -359,8 +359,9 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
                        intent.getParcelableExtra(AvrcpControllerService.EXTRA_PLAYBACK);
                MediaMetadata mmd =
                        intent.getParcelableExtra(AvrcpControllerService.EXTRA_METADATA);
                mAvrcpCommandQueue.obtainMessage(
                    MSG_TRACK, new Pair<PlaybackState, MediaMetadata>(pbb, mmd)).sendToTarget();
                mAvrcpCommandQueue
                        .obtainMessage(MSG_TRACK, new Pair<PlaybackState, MediaMetadata>(pbb, mmd))
                        .sendToTarget();
            } else if (AvrcpControllerService.ACTION_FOLDER_LIST.equals(action)) {
                mAvrcpCommandQueue.obtainMessage(MSG_FOLDER_LIST, intent).sendToTarget();
            }
@@ -432,6 +433,8 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
        // Set device to null.
        mA2dpDevice = null;
        mBrowseConnected = false;
        // update playerList.
        notifyChildrenChanged("__ROOT__");
    }

    private void msgTrack(PlaybackState pb, MediaMetadata mmd) {
@@ -506,6 +509,8 @@ public class A2dpMediaBrowserService extends MediaBrowserService {
            return;
        }
        mBrowseConnected = true;
        // update playerList
        notifyChildrenChanged("__ROOT__");
    }

    private void msgFolderList(Intent intent) {
+1 −1
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ public class AvrcpControllerService extends ProfileService {
    public synchronized boolean getChildren(
            BluetoothDevice device, String parentMediaId, int start, int items) {
        if (DBG) {
            Log.d(TAG, "getChildrent device = " + device + " parent " + parentMediaId);
            Log.d(TAG, "getChildren device = " + device + " parent " + parentMediaId);
        }

        if (device == null) {