Remove Profile Auto connection specific logic

Remove  profile auto connection specific logic as it is not implemented in
Bluetooth app
Disconnect PBAP server connection  when user initiates device level disconnection

Change-Id: I381ed96f6b57f414bbaccd694f55d2b992e330a4
This commit is contained in:
Ganesh Ganapathi Batta
2012-07-31 16:12:46 -07:00
committed by Matthew Xie
parent 9effd14611
commit 0654b71534
10 changed files with 165 additions and 262 deletions

View File

@@ -78,14 +78,12 @@ final class HeadsetProfile implements LocalBluetoothProfile {
}
mProfileManager.callServiceConnectedListeners();
mProfileManager.setHfServiceUp(true);
mIsProfileReady=true;
}
public void onServiceDisconnected(int profile) {
if (V) Log.d(TAG,"Bluetooth service disconnected");
mProfileManager.callServiceDisconnectedListeners();
mProfileManager.setHfServiceUp(false);
mIsProfileReady=false;
}
}
@@ -167,12 +165,6 @@ final class HeadsetProfile implements LocalBluetoothProfile {
}
}
public void setUnbonded(BluetoothDevice device)
{
if (mService == null) return;
mService.setPriority(device, BluetoothProfile.PRIORITY_UNDEFINED);
}
public List<BluetoothDevice> getConnectedDevices() {
if (mService == null) return new ArrayList<BluetoothDevice>(0);
return mService.getDevicesMatchingConnectionStates(
@@ -181,21 +173,6 @@ final class HeadsetProfile implements LocalBluetoothProfile {
BluetoothProfile.STATE_DISCONNECTING});
}
// This function is added as the AUTO CONNECT priority could not be set by using setPreferred(),
// as setPreferred() takes only boolean input but getPreferred() supports interger output.
// Also this need not implemented by all profiles so this has been added here.
public void enableAutoConnect(BluetoothDevice device, boolean enable) {
if (mService == null) return;
if (enable) {
mService.setPriority(device, BluetoothProfile.PRIORITY_AUTO_CONNECT);
} else {
if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
mService.setPriority(device, BluetoothProfile.PRIORITY_ON);
}
}
}
public String toString() {
return NAME;
}