Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Settings: Commit

packages/apps/Settings


Commit MetaInfo

Revisión05902a0634109fb2c20eeb10bd1b7a8e9b82eda5 (tree)
Tiempo2018-08-11 05:29:10
AutorHansong Zhang <hsz@goog...>
Commiterandroid-build-team Robot

Log Message

DO NOT MERGE Give PBAP permission only after user confirms

Bug: 72872376
Test: manual
Change-Id: I9617e3c10bf19e22f9a8f172332a83bbbebaf4a4
(cherry picked from commit e36ca3e96d8c014d39f6ffa377f5e5fc69e1f4c5)

Cambiar Resumen

Diferencia incremental

--- 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,
5757 private int mPasskey;
5858 private String mDeviceName;
5959 private LocalBluetoothProfile mPbapClientProfile;
60+ private boolean mPbapAllowed;
6061
6162 /**
6263 * Creates an instance of a BluetoothPairingController.
@@ -87,15 +88,20 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
8788 @Override
8889 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
8990 if (isChecked) {
90- mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
91+ mPbapAllowed = true;
9192 } else {
92- mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
93+ mPbapAllowed = false;
9394 }
9495 }
9596
9697 @Override
9798 public void onDialogPositiveClick(BluetoothPairingDialogFragment dialog) {
9899 if (getDialogType() == USER_ENTRY_DIALOG) {
100+ if (mPbapAllowed) {
101+ mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
102+ } else {
103+ mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
104+ }
99105 onPair(mUserInput);
100106 } else {
101107 onPair(null);
@@ -104,6 +110,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
104110
105111 @Override
106112 public void onDialogNegativeClick(BluetoothPairingDialogFragment dialog) {
113+ mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
107114 onCancel();
108115 }
109116
Show on old repository browser