Merge "Add PBAP checkbox for BT pairing consent dialog." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7171d6864f
@@ -86,16 +86,15 @@
|
|||||||
android:textColor="@*android:color/secondary_text_material_light"
|
android:textColor="@*android:color/secondary_text_material_light"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<CheckBox
|
||||||
android:id="@+id/phonebook_sharing_message"
|
android:id="@+id/phonebook_sharing_message_confirm_pin"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/bluetooth_dialog_padding"
|
android:layout_marginStart="@dimen/bluetooth_dialog_padding"
|
||||||
android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
|
android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
|
||||||
android:layout_marginBottom="@dimen/bluetooth_dialog_padding"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/bluetooth_pairing_will_share_phonebook"
|
android:text="@string/bluetooth_pairing_shares_phonebook"
|
||||||
android:textSize="12sp" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -87,16 +87,15 @@
|
|||||||
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
|
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
|
||||||
android:textColor="@*android:color/secondary_text_material_light"/>
|
android:textColor="@*android:color/secondary_text_material_light"/>
|
||||||
|
|
||||||
<TextView
|
<CheckBox
|
||||||
android:id="@+id/phonebook_sharing_message"
|
android:id="@+id/phonebook_sharing_message_entry_pin"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/bluetooth_dialog_padding"
|
android:layout_marginStart="@dimen/bluetooth_dialog_padding"
|
||||||
android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
|
android:layout_marginEnd="@dimen/bluetooth_dialog_padding"
|
||||||
android:layout_marginBottom="@dimen/bluetooth_dialog_padding"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="@string/bluetooth_pairing_will_share_phonebook"
|
android:text="@string/bluetooth_pairing_shares_phonebook"
|
||||||
android:textSize="12sp" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -1155,8 +1155,6 @@
|
|||||||
<!-- Message when bluetooth dialog when passkey or pin needs to be displayed. -->
|
<!-- Message when bluetooth dialog when passkey or pin needs to be displayed. -->
|
||||||
<string name="bluetooth_display_passkey_pin_msg">To pair with:<xliff:g id="bold1"><br><b></xliff:g><xliff:g id="device_name">%1$s</xliff:g><xliff:g id="end_bold1"></b><br><br></xliff:g>Type on it:<xliff:g id="bold2"><br><b></xliff:g><xliff:g id="passkey">%2$s</xliff:g><xliff:g id="end_bold2"></b></xliff:g>, then press Return or Enter.</string>
|
<string name="bluetooth_display_passkey_pin_msg">To pair with:<xliff:g id="bold1"><br><b></xliff:g><xliff:g id="device_name">%1$s</xliff:g><xliff:g id="end_bold1"></b><br><br></xliff:g>Type on it:<xliff:g id="bold2"><br><b></xliff:g><xliff:g id="passkey">%2$s</xliff:g><xliff:g id="end_bold2"></b></xliff:g>, then press Return or Enter.</string>
|
||||||
|
|
||||||
<!-- Message in pairing dialogs. [CHAR LIMIT=NONE] -->
|
|
||||||
<string name="bluetooth_pairing_will_share_phonebook">Pairing grants access to your contacts and call history when connected.</string>
|
|
||||||
<!-- Checkbox message in pairing dialogs. [CHAR LIMIT=NONE] -->
|
<!-- Checkbox message in pairing dialogs. [CHAR LIMIT=NONE] -->
|
||||||
<string name="bluetooth_pairing_shares_phonebook">Grant access to your contacts and call history when connected.</string>
|
<string name="bluetooth_pairing_shares_phonebook">Grant access to your contacts and call history when connected.</string>
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.bluetooth;
|
package com.android.settings.bluetooth;
|
||||||
|
|
||||||
|
import android.bluetooth.BluetoothClass;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
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 messageViewContent = (TextView) view.findViewById(R.id.message_subhead);
|
||||||
TextView messageView2 = (TextView) view.findViewById(R.id.message_below_pin);
|
TextView messageView2 = (TextView) view.findViewById(R.id.message_below_pin);
|
||||||
CheckBox alphanumericPin = (CheckBox) view.findViewById(R.id.alphanumeric_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 = (EditText) view.findViewById(R.id.text);
|
||||||
mPairingView.addTextChangedListener(this);
|
mPairingView.addTextChangedListener(this);
|
||||||
alphanumericPin.setOnCheckedChangeListener(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 pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption);
|
||||||
TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
|
TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
|
||||||
TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message);
|
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 messageCaption = null;
|
||||||
String pairingContent = null;
|
String pairingContent = null;
|
||||||
|
Reference in New Issue
Block a user