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

Commit 819011b1 authored by Ajay Panicker's avatar Ajay Panicker Committed by Myles Watson
Browse files

AVRCP: Don't fail in set_volume on disconnected devices

Test: Change the volume on a headset with absolute volume
Bug: 72987704
Change-Id: Ia1acd28c51707e7b71e47140aaded0298ba4e8aa
parent a5905c76
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2501,12 +2501,7 @@ static bt_status_t set_volume(uint8_t volume) {
  tAVRC_STS status = BT_STATUS_UNSUPPORTED;

  for (int idx = 0; idx < BTIF_RC_NUM_CONN; idx++) {
    if (!btif_rc_cb.rc_multi_cb[idx].rc_connected) {
      status = BT_STATUS_NOT_READY;
      BTIF_TRACE_ERROR("%s: RC is not connected for device: 0x%x", __func__,
                       btif_rc_cb.rc_multi_cb[idx].rc_addr);
      continue;
    }
    if (!btif_rc_cb.rc_multi_cb[idx].rc_connected) continue;

    if (btif_rc_cb.rc_multi_cb[idx].rc_volume == volume) {
      status = BT_STATUS_DONE;