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

Commit 0f0c5d17 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk Committed by Jakub Pawlowski
Browse files

Use safe_union correctly

As described in source.android.com/devices/architecture/hidl/safe_union
value must be assigned through generated getter, rather than assigning it directly.

Test: vts-tradefed run vts -m VtsHalBluetoothAudioV2_1TargetTest
Sponsor: jpawlowski@
Bug: 150670922
Change-Id: Iefc7ee98163ec2b3387fc01c3d69c1dcd15e94bc
parent e5d68ba2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -57,14 +57,14 @@ Return<void> BluetoothAudioProvider::startSession(

  if (audioConfig.getDiscriminator() ==
      V2_0::AudioConfiguration::hidl_discriminator::pcmConfig) {
    audioConfig_2_1.pcmConfig() = {
    audioConfig_2_1.pcmConfig({
        .sampleRate =
            static_cast<SampleRate>(audioConfig.pcmConfig().sampleRate),
        .channelMode = audioConfig.pcmConfig().channelMode,
        .bitsPerSample = audioConfig.pcmConfig().bitsPerSample,
        .dataIntervalUs = 0};
        .dataIntervalUs = 0});
  } else {
    audioConfig_2_1.codecConfig() = audioConfig.codecConfig();
    audioConfig_2_1.codecConfig(audioConfig.codecConfig());
  }

  return startSession_2_1(hostIf, audioConfig_2_1, _hidl_cb);