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

Commit 0bb2460b authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "le_audio: Remove unused Le Audio client source mocks" am: 980a4a61...

Merge "le_audio: Remove unused Le Audio client source mocks" am: 980a4a61 am: 66b91539 am: 18cb805a

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

Change-Id: I7a5c7e0bf4f2c1df8a72a3c6f15a3867d5a89d05
parents 54f0f187 18cb805a
Loading
Loading
Loading
Loading
+0 −59
Original line number Diff line number Diff line
/*
 * Copyright 2020 HIMSA II K/S - www.himsa.com.
 * Represented by EHIMA - www.ehima.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "mock_le_audio_client_audio_source.h"

static MockLeAudioClientAudioSource* instance;
void MockLeAudioClientAudioSource::SetMockInstanceForTesting(
    MockLeAudioClientAudioSource* mock) {
  instance = mock;
}

bool LeAudioClientAudioSource::Start(
    const LeAudioCodecConfiguration& codecConfiguration,
    LeAudioClientAudioSinkReceiver* audioReceiver, uint16_t remote_delay_ms) {
  return instance->Start(codecConfiguration, audioReceiver, remote_delay_ms);
}

void LeAudioClientAudioSource::Stop() { instance->Stop(); }

// FIXME: This is wrong! we will return a different class object - not even in
// inheritance hierarchy
const void* LeAudioClientAudioSource::Acquire() { return instance->Acquire(); }

void LeAudioClientAudioSource::Release(const void* inst) {
  instance->Release(inst);
}

void LeAudioClientAudioSource::ConfirmStreamingRequest() {
  instance->ConfirmStreamingRequest();
}

void LeAudioClientAudioSource::CancelStreamingRequest() {
  instance->CancelStreamingRequest();
}

void LeAudioClientAudioSource::UpdateAudioConfigToHal(
    const ::le_audio::offload_config& config) {
  instance->UpdateAudioConfigToHal(config);
}

void LeAudioClientAudioSource::SuspendedForReconfiguration() {
  instance->SuspendedForReconfiguration();
}

void LeAudioClientAudioSource::DebugDump(int fd) { instance->DebugDump(fd); }
+0 −35
Original line number Diff line number Diff line
/*
 * Copyright 2020 HIMSA II K/S - www.himsa.com.
 * Represented by EHIMA - www.ehima.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <gmock/gmock.h>

#include "client_audio.h"

class MockLeAudioClientAudioSource {
 public:
  static void SetMockInstanceForTesting(MockLeAudioClientAudioSource* mock);
  MOCK_METHOD((bool), Start,
              (const LeAudioCodecConfiguration& codecConfiguration,
               LeAudioClientAudioSinkReceiver* audioReceiver,
               uint16_t remote_delay_ms));
  MOCK_METHOD((void), Stop, ());
  MOCK_METHOD((const void*), Acquire, ());
  MOCK_METHOD((void), Release, (const void*));
  MOCK_METHOD((void), DebugDump, (int fd));
};