Add PBAP checkbox for BT pairing consent dialog.

Bug: 20488109
Change-Id: Ib6c98c27e6d2b8e59fa4b640df15214a6b197853
This commit is contained in:
Sanket Padawe
2015-06-12 18:09:45 -07:00
parent e27e3bcf9e
commit 2ef44c5e5d
4 changed files with 45 additions and 12 deletions

View File

@@ -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;