summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2010-05-24 18:00:56 -0700
committerJaikumar Ganesh <jaikumar@google.com>2010-05-24 18:00:56 -0700
commitd432bf76de6f7284187040de30ad6af2d6d765da (patch)
tree473d57ae73939f8db0ca95d33e5c3056d48782a3 /src
parent687094b42f2f5670003a950c2dc29233d46411d3 (diff)
downloadpackages_apps_Settings-d432bf76de6f7284187040de30ad6af2d6d765da.zip
packages_apps_Settings-d432bf76de6f7284187040de30ad6af2d6d765da.tar.gz
packages_apps_Settings-d432bf76de6f7284187040de30ad6af2d6d765da.tar.bz2
Set profiles as preferred and then try to connect.
The APIs implementations are being updated to expose A2DP and HFP APIs. A connect call is not honoured if its not a preferred profile. So if an app changes the preference of the profile than it should first update the state before making the connect call. The API for updating preference might not be exposed and will be mostly an API for app with ADMIN privileges like Settings app. Change-Id: I58b8e8201357bcfe615dc2322342520319d9e355
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/bluetooth/ConnectSpecificProfilesActivity.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/settings/bluetooth/ConnectSpecificProfilesActivity.java b/src/com/android/settings/bluetooth/ConnectSpecificProfilesActivity.java
index 08534f3..2a8af5f 100644
--- a/src/com/android/settings/bluetooth/ConnectSpecificProfilesActivity.java
+++ b/src/com/android/settings/bluetooth/ConnectSpecificProfilesActivity.java
@@ -179,6 +179,9 @@ public class ConnectSpecificProfilesActivity extends PreferenceActivity
}
private void onProfileCheckedStateChanged(Profile profile, boolean checked) {
+ LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
+ .getProfileManager(mManager, profile);
+ profileManager.setPreferred(mCachedDevice.getDevice(), checked);
if (mOnlineMode) {
if (checked) {
mCachedDevice.connect(profile);
@@ -186,10 +189,6 @@ public class ConnectSpecificProfilesActivity extends PreferenceActivity
mCachedDevice.disconnect(profile);
}
}
-
- LocalBluetoothProfileManager profileManager = LocalBluetoothProfileManager
- .getProfileManager(mManager, profile);
- profileManager.setPreferred(mCachedDevice.getDevice(), checked);
}
public void onDeviceAttributesChanged(CachedBluetoothDevice cachedDevice) {