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

Commit cd6454f2 authored by Henri Chataing's avatar Henri Chataing Committed by Automerger Merge Worker
Browse files

hearing_aid: Explicitly request encryption when creating audio channel am:...

hearing_aid: Explicitly request encryption when creating audio channel am: 80ae7b56 am: 22ed7f76

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3112119



Change-Id: I444d2b310999bbe9082f4f9b0d2c960a2692e65e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 06b6a98b 22ed7f76
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1100,7 +1100,17 @@ class HearingAidImpl : public HearingAid {
                             : BTM_SEC_SERVICE_HEARING_AID_RIGHT;
    uint16_t gap_handle = GAP_ConnOpen(
        "", service_id, false, &hearingDevice->address, psm, 514 /* MPS */,
        &cfg_info, nullptr, BTM_SEC_NONE /* TODO: request security ? */,
        &cfg_info, nullptr,
        /// b/309483354:
        /// Encryption needs to be explicitly requested at channel
        /// establishment even though validation is performed in this module
        /// because of re-connection logic present in the L2CAP module.
        /// The L2CAP will automatically reconnect the LE-ACL link on
        /// disconnection when there is a pending channel request,
        /// which invalidates all encryption checks performed here.
        com::android::bluetooth::flags::asha_asrc()
            ? BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT
            : BTM_SEC_NONE,
        HearingAidImpl::GapCallbackStatic, BT_TRANSPORT_LE);

    if (gap_handle == GAP_INVALID_HANDLE) {