summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-11-16 14:43:08 -0800
committerSteve Kondik <steve@cyngn.com>2015-11-16 14:43:08 -0800
commite6aed7196211928232ee005bd37a6a220ac64e64 (patch)
treee4d277867c608ed65edd9be63d9da7d53007d893 /src/com/android/settings/bluetooth
parenteeef647fe68714d843bf2bb7c39251c89f62f172 (diff)
parentc9d123c33452bf651b0c6b8c9754f7bf1766e931 (diff)
downloadpackages_apps_Settings-e6aed7196211928232ee005bd37a6a220ac64e64.zip
packages_apps_Settings-e6aed7196211928232ee005bd37a6a220ac64e64.tar.gz
packages_apps_Settings-e6aed7196211928232ee005bd37a6a220ac64e64.tar.bz2
Merge branch 'LA.BF64.1.2.2_rb4.7' of git://codeaurora.org/platform/packages/apps/Settings into cm-13.0
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--[-rwxr-xr-x]src/com/android/settings/bluetooth/DeviceProfilesSettings.java33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index b7d837b..abee8cc 100755..100644
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -174,11 +174,16 @@ public final class DeviceProfilesSettings extends DialogFragment implements
private void addPreferencesForProfiles() {
mProfileContainer.removeAllViews();
for (LocalBluetoothProfile profile : mCachedDevice.getConnectableProfiles()) {
- CheckBox pref = createProfilePreference(profile);
- mProfileContainer.addView(pref);
+ // MAP and PBAP profiles would be added based on permission access
+ if (!((profile instanceof PbapServerProfile) ||
+ (profile instanceof MapProfile))) {
+ CheckBox pref = createProfilePreference(profile);
+ mProfileContainer.addView(pref);
+ }
}
final int pbapPermission = mCachedDevice.getPhonebookPermissionChoice();
+ Log.d(TAG, "addPreferencesForProfiles: pbapPermission = " + pbapPermission);
// Only provide PBAP cabability if the client device has requested PBAP.
if (pbapPermission != CachedBluetoothDevice.ACCESS_UNKNOWN) {
final PbapServerProfile psp = mManager.getProfileManager().getPbapProfile();
@@ -188,6 +193,7 @@ public final class DeviceProfilesSettings extends DialogFragment implements
final MapProfile mapProfile = mManager.getProfileManager().getMapProfile();
final int mapPermission = mCachedDevice.getMessagePermissionChoice();
+ Log.d(TAG, "addPreferencesForProfiles: mapPermission = " + mapPermission);
if (mapPermission != CachedBluetoothDevice.ACCESS_UNKNOWN) {
CheckBox mapPreference = createProfilePreference(mapProfile);
mProfileContainer.addView(mapPreference);
@@ -242,15 +248,6 @@ public final class DeviceProfilesSettings extends DialogFragment implements
private void onProfileClicked(LocalBluetoothProfile profile, CheckBox profilePref) {
BluetoothDevice device = mCachedDevice.getDevice();
- if (KEY_PBAP_SERVER.equals(profilePref.getTag())) {
- final int newPermission = mCachedDevice.getPhonebookPermissionChoice()
- == CachedBluetoothDevice.ACCESS_ALLOWED ? CachedBluetoothDevice.ACCESS_REJECTED
- : CachedBluetoothDevice.ACCESS_ALLOWED;
- mCachedDevice.setPhonebookPermissionChoice(newPermission);
- profilePref.setChecked(newPermission == CachedBluetoothDevice.ACCESS_ALLOWED);
- return;
- }
-
if (!profilePref.isChecked()) {
// Recheck it, until the dialog is done.
profilePref.setChecked(true);
@@ -259,6 +256,11 @@ public final class DeviceProfilesSettings extends DialogFragment implements
if (profile instanceof MapProfile) {
mCachedDevice.setMessagePermissionChoice(BluetoothDevice.ACCESS_ALLOWED);
}
+ if (profile instanceof PbapServerProfile) {
+ mCachedDevice.setPhonebookPermissionChoice(BluetoothDevice.ACCESS_ALLOWED);
+ refreshProfilePreference(profilePref, profile);
+ return;
+ }
if (profile.isPreferred(device)) {
// profile is preferred but not connected: disable auto-connect
if (profile instanceof PanProfile) {
@@ -296,9 +298,12 @@ public final class DeviceProfilesSettings extends DialogFragment implements
if (which == OK_BUTTON) {
device.disconnect(profile);
profile.setPreferred(device.getDevice(), false);
- }
- if (profile instanceof MapProfile) {
- device.setMessagePermissionChoice(BluetoothDevice.ACCESS_REJECTED);
+ if (profile instanceof MapProfile) {
+ device.setMessagePermissionChoice(BluetoothDevice.ACCESS_REJECTED);
+ }
+ if (profile instanceof PbapServerProfile) {
+ device.setPhonebookPermissionChoice(BluetoothDevice.ACCESS_REJECTED);
+ }
}
refreshProfilePreference(findProfile(profile.toString()), profile);
}