AVRCP: Check if browse service is connected for a player

In device reboot usecases, during browse player initialization,
media browse service is not connected to media player sometimes
because player is not initialized yet. If remote device is
connected, browsing will not work as browse feature bit for the
player will be reset. To fix browsing issue, check if browse
service is connected or retry when setting browse package.

Change-Id: I3592c69118f18cf5f6ed4ef812baaea728e644f2
diff --git a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
index 55a989a..cd1d595 100644
--- a/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
+++ b/packages_apps_bluetooth_ext/src/avrcp/Avrcp_ext.java
@@ -3288,6 +3288,7 @@
 
     private void SetBrowsePackage(String PackageName) {
         String browseService = (PackageName != null)?getBrowseServiceName(PackageName):null;
+        BrowsedMediaPlayer_ext player = mAvrcpBrowseManager.getBrowsedMediaPlayer(dummyaddr);
         Log.w(TAG, "SetBrowsePackage for pkg " + PackageName + "svc" + browseService);
         if (browseService != null && !browseService.isEmpty()) {
             BluetoothDevice active_device = null;
@@ -3306,6 +3307,10 @@
                     Log.w(TAG, "Addr Player update to Browse " + PackageName);
                     mAvrcpBrowseManager.getBrowsedMediaPlayer(addr).
                             setCurrentPackage(PackageName, browseService);
+                    if (player != null) {
+                        Log.w(TAG,"checkMBSConnection try connect");
+                        player.CheckMBSConnection(PackageName, browseService);
+                    }
                 }
             } else {
                 Log.w(TAG, "SetBrowsePackage Active device not set yet cache " + PackageName +