summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorAndre Eisenbach <eisenbach@google.com>2015-06-02 01:48:29 -0700
committerAndre Eisenbach <eisenbach@google.com>2015-06-02 01:59:37 -0700
commit901ce5de8d7276770bc6dc0b0fd66138218640d8 (patch)
tree69ca0caff9d4b026355f82f6965235a85d0a0a63 /src/com/android/settings/bluetooth
parentafa6361d36f522b4361c4a91a33edd39d322363a (diff)
downloadpackages_apps_Settings-901ce5de8d7276770bc6dc0b0fd66138218640d8.zip
packages_apps_Settings-901ce5de8d7276770bc6dc0b0fd66138218640d8.tar.gz
packages_apps_Settings-901ce5de8d7276770bc6dc0b0fd66138218640d8.tar.bz2
Bluetooth PAN: Set isPreferred to true (2/2)
isPreferred must always be true for PAN so that the DUT can initiate a PANU connection with the remote device not only from the internet access menu in the profile setting, but also from the paired device list menu. Currently isPreferred is only true when PAN is in connected state for the PANU role, so it will return false when the PAN profile is not connected and the PANU connection will never be initiated from the paired device list menu. Change-Id: I3d52d89136269508ac6416b695b22842f4bb557a
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rwxr-xr-xsrc/com/android/settings/bluetooth/DeviceProfilesSettings.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index 1df6275..e58abd6 100755
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -39,6 +39,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import com.android.settingslib.bluetooth.MapProfile;
+import com.android.settingslib.bluetooth.PanProfile;
import com.android.settingslib.bluetooth.PbapServerProfile;
import java.util.HashMap;
@@ -244,8 +245,12 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
}
if (profile.isPreferred(device)) {
// profile is preferred but not connected: disable auto-connect
- profile.setPreferred(device, false);
- refreshProfilePreference(profilePref, profile);
+ if (profile instanceof PanProfile) {
+ mCachedDevice.connectProfile(profile);
+ } else {
+ profile.setPreferred(device, false);
+ refreshProfilePreference(profilePref, profile);
+ }
} else {
profile.setPreferred(device, true);
mCachedDevice.connectProfile(profile);
@@ -330,10 +335,15 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
if (profile instanceof MapProfile) {
profilePref.setChecked(mCachedDevice.getMessagePermissionChoice()
== CachedBluetoothDevice.ACCESS_ALLOWED);
+
} else if (profile instanceof PbapServerProfile) {
- // Handle PBAP specially.
profilePref.setChecked(mCachedDevice.getPhonebookPermissionChoice()
== CachedBluetoothDevice.ACCESS_ALLOWED);
+
+ } else if (profile instanceof PanProfile) {
+ profilePref.setChecked(profile.getConnectionStatus(device) ==
+ BluetoothProfile.STATE_CONNECTED);
+
} else {
profilePref.setChecked(profile.isPreferred(device));
}