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

Commit dd01873f authored by Nitin Srivastava's avatar Nitin Srivastava Committed by Zhihai Xu
Browse files

Bluetooth: Clear Notification array on AVRCP disconnect

DUT does not clear previous AVRCP notification registration
on AVCTP disconnect hence DUT sends response even when remote
device hasn't registered.
Changes made to clear notification array and while sending
notification respose check if event is registered.

Change-Id: I610f8ae6381a63236378f179bb2a619ec0c6549e
parent 2e947fa1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -467,6 +467,7 @@ void handle_rc_disconnect (tBTA_AV_RC_CLOSE *p_rc_close)
    btif_rc_cb.rc_handle = 0;
    btif_rc_cb.rc_connected = FALSE;
    memset(btif_rc_cb.rc_addr, 0, sizeof(BD_ADDR));
    memset(btif_rc_cb.rc_notif, 0, sizeof(btif_rc_cb.rc_notif));
    btif_rc_cb.rc_features = 0;
    btif_rc_cb.rc_vol_label=MAX_LABEL;
    btif_rc_cb.rc_volume=MAX_VOLUME;
@@ -1226,6 +1227,11 @@ static bt_status_t register_notification_rsp(btrc_event_id_t event_id,
    tAVRC_RESPONSE avrc_rsp;
    CHECK_RC_CONNECTED
    BTIF_TRACE_EVENT2("## %s ## event_id:%s", __FUNCTION__, dump_rc_notification_event_id(event_id));
    if (btif_rc_cb.rc_notif[event_id-1].bNotify == FALSE)
    {
        BTIF_TRACE_ERROR1("Avrcp Event id not registered: event_id = %x", event_id);
        return BT_STATUS_NOT_READY;
    }
    memset(&(avrc_rsp.reg_notif), 0, sizeof(tAVRC_REG_NOTIF_RSP));
    avrc_rsp.reg_notif.event_id = event_id;