Remove A2DP connect logic from settingslib

A2dpProfile will disconnect current device when receive connect event
and max connectable device is one. Ideally we shouldn't have any
bluetooth code in settingslib. The corresponding logic is moved to
the Bluetooth A2dpService.

Bug: 111812003
Test: 1. Developer options > Maxium connected Bluetooth device > 1.
      2. Connected 2 BT Headset respectively

Change-Id: I298c39942756523b8a2b34a4104bcd247d2455eb
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
index 24037a6..65535b5 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
@@ -133,20 +133,6 @@
 
     public boolean connect(BluetoothDevice device) {
         if (mService == null) return false;
-        int max_connected_devices = mLocalAdapter.getMaxConnectedAudioDevices();
-        if (max_connected_devices == 1) {
-            // Original behavior: disconnect currently connected device
-            List<BluetoothDevice> sinks = getConnectedDevices();
-            if (sinks != null) {
-                for (BluetoothDevice sink : sinks) {
-                    if (sink.equals(device)) {
-                        Log.w(TAG, "Connecting to device " + device + " : disconnect skipped");
-                        continue;
-                    }
-                    mService.disconnect(sink);
-                }
-            }
-        }
         return mService.connect(device);
     }
 
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java
index 38c8a88..cbeeed8 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java
@@ -246,10 +246,6 @@
         return mAdapter.getRemoteDevice(address);
     }
 
-    public int getMaxConnectedAudioDevices() {
-        return mAdapter.getMaxConnectedAudioDevices();
-    }
-
     public List<Integer> getSupportedProfiles() {
         return mAdapter.getSupportedProfiles();
     }