Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec25157a authored by Sanket Padawe's avatar Sanket Padawe Committed by The Android Automerger
Browse files

Uncheck checkbox for contact sharing by default for non carkit devices.

+ In BT pairing dialog, uncheck checkbox for contact sharing by default
for devices not recognized as carkits at pair time.

Bug: 23607427
Change-Id: I7f1d40d86e713e248d3c225459be4895c4f75d76
parent da91ef8b
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -195,8 +195,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements
        } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){
            contactSharing.setChecked(false);
        } else {
            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() {
@@ -209,12 +215,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);
@@ -267,8 +268,14 @@ public final class BluetoothPairingDialog extends AlertActivity implements
        } else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED){
            contactSharing.setChecked(false);
        } else {
            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() {
@@ -281,12 +288,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;