diff options
author | Andre Eisenbach <eisenbach@google.com> | 2015-06-02 09:00:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-02 09:00:31 +0000 |
commit | 7292d89280f7c4814e8fa93903dc73e3515b6558 (patch) | |
tree | 54f19eff912f45a27a9c84f17e1f038146b5d817 | |
parent | 6c91ae68d98431142a5ea3a92601535e5d6c91f0 (diff) | |
parent | 901ce5de8d7276770bc6dc0b0fd66138218640d8 (diff) | |
download | packages_apps_Settings-7292d89280f7c4814e8fa93903dc73e3515b6558.zip packages_apps_Settings-7292d89280f7c4814e8fa93903dc73e3515b6558.tar.gz packages_apps_Settings-7292d89280f7c4814e8fa93903dc73e3515b6558.tar.bz2 |
Merge "Bluetooth PAN: Set isPreferred to true (2/2)" into mnc-dev
-rwxr-xr-x | src/com/android/settings/bluetooth/DeviceProfilesSettings.java | 16 |
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)); } |