X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcom%2Fandroid%2Fsettings%2Fbluetooth%2FBluetoothPairingController.java;h=5120cc0ff9bd7708f3f99ac90bd811788c43b1e6;hb=500c83c1bc214f1075ac69debb50f489ab35e26c;hp=7d2d7b48c309017e11627bddbf9137531ea4ad1c;hpb=9a61e915b4189bb7056377be0d3be6828623ee9f;p=android-x86%2Fpackages-apps-Settings.git diff --git a/src/com/android/settings/bluetooth/BluetoothPairingController.java b/src/com/android/settings/bluetooth/BluetoothPairingController.java index 7d2d7b48c3..5120cc0ff9 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingController.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingController.java @@ -57,6 +57,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, private int mPasskey; private String mDeviceName; private LocalBluetoothProfile mPbapClientProfile; + private boolean mPbapAllowed; /** * Creates an instance of a BluetoothPairingController. @@ -87,15 +88,20 @@ public class BluetoothPairingController implements OnCheckedChangeListener, @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + mPbapAllowed = true; } else { - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + mPbapAllowed = false; } } @Override public void onDialogPositiveClick(BluetoothPairingDialogFragment dialog) { if (getDialogType() == USER_ENTRY_DIALOG) { + if (mPbapAllowed) { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + } else { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + } onPair(mUserInput); } else { onPair(null); @@ -104,6 +110,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, @Override public void onDialogNegativeClick(BluetoothPairingDialogFragment dialog) { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); onCancel(); }