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

Commit a84a5357 authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

Merge "Bluetooth: Give PBAP permission only if device is AUDIO_VIDEO_HANDSFREE"

am: b21a10b2

Change-Id: Id0378b1c410afcc0566652e3308cd812dcd68470
parents 9d305923 b21a10b2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -171,6 +171,22 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
        }
    }

    /**
     * Update Phone book permission
     *
     */
     public void  setContactSharingState() {
        if ((mDevice.getPhonebookAccessPermission() != BluetoothDevice.ACCESS_ALLOWED)
                && (mDevice.getPhonebookAccessPermission() != BluetoothDevice.ACCESS_REJECTED)) {
                 if (mDevice.getBluetoothClass().getDeviceClass()
                        == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
                    onCheckedChanged(null, true);
            } else {
                onCheckedChanged(null, false);
            }
        }
    }

    /**
     * A method for querying if the provided editable is a valid passkey/pin format for this device.
     *
+2 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i

        contactSharing.setVisibility(mPairingController.isProfileReady()
                ? View.GONE : View.VISIBLE);
        mPairingController.setContactSharingState();
        contactSharing.setOnCheckedChangeListener(mPairingController);
        contactSharing.setChecked(mPairingController.getContactSharingState());

@@ -331,6 +332,7 @@ public class BluetoothPairingDialogFragment extends InstrumentedDialogFragment i

        contactSharing.setVisibility(
                mPairingController.isProfileReady() ? View.GONE : View.VISIBLE);
        mPairingController.setContactSharingState();
        contactSharing.setChecked(mPairingController.getContactSharingState());
        contactSharing.setOnCheckedChangeListener(mPairingController);