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

Commit a60f73f6 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Ignore invalid MetadataUpdate

Seems that on Voice call scenario, we are receiving invalid contet type
and usage.
For now just ignore it.

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compile

Change-Id: Id1d2ac800d219cd0196f31547c68f8f771c0d34e
parent 7fc3d1cb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2541,6 +2541,12 @@ class LeAudioClientImpl : public LeAudioClient {
    std::vector<LeAudioContextType> contexts;

    while (track_count) {
      if (tracks->content_type == 0 && tracks->usage == 0) {
        --track_count;
        ++tracks;
        continue;
      }

      DLOG(INFO) << __func__ << ": usage=" << tracks->usage
                 << ", content_type=" << tracks->content_type
                 << ", gain=" << tracks->gain;
@@ -2553,6 +2559,11 @@ class LeAudioClientImpl : public LeAudioClient {
      ++tracks;
    }

    if (contexts.empty()) {
      DLOG(INFO) << __func__ << " invalid metadata update";
      return;
    }

    auto new_context = ChooseContextType(contexts);

    auto group = aseGroups_.FindById(active_group_id_);