diff options
author | Sanket Padawe <sanketpadawe@google.com> | 2015-06-12 18:09:45 -0700 |
---|---|---|
committer | Sanket Padawe <sanketpadawe@google.com> | 2015-06-12 18:09:45 -0700 |
commit | 2ef44c5e5def598d07f599675982e1a8b3aefc73 (patch) | |
tree | 1e1123f96849c523c9d3917a32b16ef5c9700479 /src/com/android/settings/bluetooth | |
parent | e27e3bcf9efcc605e56de7c0257c6a02527601a0 (diff) | |
download | packages_apps_Settings-2ef44c5e5def598d07f599675982e1a8b3aefc73.zip packages_apps_Settings-2ef44c5e5def598d07f599675982e1a8b3aefc73.tar.gz packages_apps_Settings-2ef44c5e5def598d07f599675982e1a8b3aefc73.tar.bz2 |
Add PBAP checkbox for BT pairing consent dialog.
Bug: 20488109
Change-Id: Ib6c98c27e6d2b8e59fa4b640df15214a6b197853
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rwxr-xr-x | src/com/android/settings/bluetooth/BluetoothPairingDialog.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java index ffe4945..29cac62 100755 --- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java @@ -16,6 +16,7 @@ package com.android.settings.bluetooth; +import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; @@ -186,6 +187,24 @@ public final class BluetoothPairingDialog extends AlertActivity implements TextView messageViewContent = (TextView) view.findViewById(R.id.message_subhead); TextView messageView2 = (TextView) view.findViewById(R.id.message_below_pin); CheckBox alphanumericPin = (CheckBox) view.findViewById(R.id.alphanumeric_pin); + CheckBox contactSharing = (CheckBox) view.findViewById( + R.id.phonebook_sharing_message_entry_pin); + contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { + if (isChecked) { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + } else { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + } + } + }); + if (mDevice.getBluetoothClass().getDeviceClass() + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { + contactSharing.setVisibility(View.VISIBLE); + } else { + contactSharing.setVisibility(View.GONE); + } mPairingView = (EditText) view.findViewById(R.id.text); mPairingView.addTextChangedListener(this); alphanumericPin.setOnCheckedChangeListener(this); @@ -238,6 +257,24 @@ public final class BluetoothPairingDialog extends AlertActivity implements TextView pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption); TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead); TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message); + CheckBox contactSharing = (CheckBox) view.findViewById( + R.id.phonebook_sharing_message_confirm_pin); + contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { + if (isChecked) { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + } else { + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + } + } + }); + if (mDevice.getBluetoothClass().getDeviceClass() + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { + contactSharing.setVisibility(View.VISIBLE); + } else { + contactSharing.setVisibility(View.GONE); + } String messageCaption = null; String pairingContent = null; |