Do not show phonebook access permission dialog if pairing dialog has already been shown.

Bug: 16964116, 13886947, 16345619

Change-Id: I9cf2622b49c3812771d57432fed030affaa5ba48
This commit is contained in:
Edward Jee
2014-09-04 22:18:21 -07:00
committed by Joe Bass
parent 13fbd848d4
commit a539716a94
6 changed files with 69 additions and 63 deletions

View File

@@ -151,7 +151,6 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
if (pbapPermission != CachedBluetoothDevice.ACCESS_UNKNOWN) {
final PbapServerProfile psp = mManager.getProfileManager().getPbapProfile();
CheckBoxPreference pbapPref = createProfilePreference(psp);
pbapPref.setChecked(pbapPermission == CachedBluetoothDevice.ACCESS_ALLOWED);
mProfileContainer.addPreference(pbapPref);
}
@@ -191,11 +190,6 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
pref.setIcon(getResources().getDrawable(iconResource));
}
/**
* Gray out profile while connecting and disconnecting
*/
pref.setEnabled(!mCachedDevice.isBusy());
refreshProfilePreference(pref, profile);
return pref;
@@ -310,11 +304,16 @@ public final class DeviceProfilesSettings extends SettingsPreferenceFragment
LocalBluetoothProfile profile) {
BluetoothDevice device = mCachedDevice.getDevice();
/*
* Gray out checkbox while connecting and disconnecting
*/
// Gray out checkbox while connecting and disconnecting.
profilePref.setEnabled(!mCachedDevice.isBusy());
profilePref.setChecked(profile.isPreferred(device));
if (profile instanceof PbapServerProfile) {
// Handle PBAP specially.
profilePref.setChecked(mCachedDevice.getPhonebookPermissionChoice()
== CachedBluetoothDevice.ACCESS_ALLOWED);
} else {
profilePref.setChecked(profile.isPreferred(device));
}
}
private LocalBluetoothProfile getProfileOf(Preference pref) {