Fix for When Hf is rejected the device should initiate A2dp if a2dp is enabled

Change-Id: I0716782a5308cc45297a30d0a7371286c75bfa52
This commit is contained in:
Swaminatha Balaji
2012-06-25 04:04:41 -07:00
committed by Matthew Xie
parent 802956ec9b
commit b45e3c8fe9
2 changed files with 49 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import com.android.settings.R;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -99,6 +100,10 @@ final class BluetoothEventManager {
// Dock event broadcasts
addHandler(Intent.ACTION_DOCK_EVENT, new DockEventHandler());
// Connect other profiles broadcast
addHandler(BluetoothProfile.ACTION_CONNECT_OTHER_PROFILES, new ConnectOtherProfilesHandler());
mContext.registerReceiver(mBroadcastReceiver, mAdapterIntentFilter);
}
@@ -368,6 +373,12 @@ final class BluetoothEventManager {
}
}
private class ConnectOtherProfilesHandler implements Handler {
public void onReceive(Context context, Intent intent, BluetoothDevice device) {
mProfileManager.handleConnectOtherProfiles(device);
}
}
boolean readPairedDevices() {
Set<BluetoothDevice> bondedDevices = mLocalAdapter.getBondedDevices();
if (bondedDevices == null) {