diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java index a2150e924dd..182344c102a 100755 --- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java @@ -193,8 +193,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){ contactSharing.setChecked(false); } else { - contactSharing.setChecked(true); - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + if (mDevice.getBluetoothClass().getDeviceClass() + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { + contactSharing.setChecked(true); + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + } else { + contactSharing.setChecked(false); + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + } } contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -207,12 +213,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements } } }); - 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); @@ -265,8 +266,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){ contactSharing.setChecked(false); } else { - contactSharing.setChecked(true); - mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + if (mDevice.getBluetoothClass().getDeviceClass() + == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { + contactSharing.setChecked(true); + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED); + } else { + contactSharing.setChecked(false); + mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED); + } } contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -279,12 +286,6 @@ public final class BluetoothPairingDialog extends AlertActivity implements } } }); - if (mDevice.getBluetoothClass().getDeviceClass() - == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) { - contactSharing.setVisibility(View.VISIBLE); - } else { - contactSharing.setVisibility(View.GONE); - } String messageCaption = null; String pairingContent = null;