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

Commit 00a44c0f authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Audio HAL: More generalization for types imports

Complement imports of audio::CPP_VERSION with audio::common::CPP_VERSION
for core.

Import namespaces in VTS tests.

Remove "using namespace" from .cpp files where there
are already imports in the .h file.

Test: try moving types between audio/types.hal and common/types.hal.
Change-Id: I49c2e2466c8175f2516c2273f5c26d125afd4801
parent 0c157d30
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ namespace common {
namespace CPP_VERSION {
namespace implementation {

using namespace ::android::hardware::audio::common::CPP_VERSION;

void HidlUtils::audioConfigFromHal(const audio_config_t& halConfig, AudioConfig* config) {
    config->sampleRateHz = halConfig.sample_rate;
    config->channelMask = EnumBitfield<AudioChannelMask>(halConfig.channel_mask);
+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@ namespace audio {
namespace CPP_VERSION {
namespace implementation {

using namespace ::android::hardware::audio::common::CPP_VERSION;

std::string deviceAddressToHal(const DeviceAddress& address) {
    // HAL assumes that the address is NUL-terminated.
    char halAddress[AUDIO_DEVICE_MAX_ADDRESS_LEN];
+0 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ namespace audio {
namespace CPP_VERSION {
namespace implementation {

using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::CPP_VERSION;

namespace {

class ReadThread : public Thread {
+0 −2
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ namespace audio {
namespace CPP_VERSION {
namespace implementation {

using ::android::hardware::audio::common::CPP_VERSION::ThreadInfo;

namespace {

class WriteThread : public Thread {
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ namespace audio {
namespace CPP_VERSION {
namespace implementation {

using namespace ::android::hardware::audio::common::CPP_VERSION;
using namespace ::android::hardware::audio::CPP_VERSION;

std::string deviceAddressToHal(const DeviceAddress& address);
Loading