diff --git a/audiohandler/src/daudio_handler.cpp b/audiohandler/src/daudio_handler.cpp index 094f6d78229011d6eab8dea63ca31618ee89d342..06e57b699811dba1cc5532bf1b1b96f8d0a7e04e 100644 --- a/audiohandler/src/daudio_handler.cpp +++ b/audiohandler/src/daudio_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 @@ -158,7 +158,7 @@ int32_t DAudioHandler::QueryCodecInfo() queryFlag = true; } - if (queryFlag == false) { + if (!queryFlag) { DHLOGE("Failed to query the codec information."); return ERR_DH_AUDIO_FAILED; } diff --git a/common/dfx_utils/test/unittest/BUILD.gn b/common/dfx_utils/test/unittest/BUILD.gn index d8e262fe25512ad90accc9b112d97b7390de30d5..3a863e45071569b84b26f79ae93068ee51e1ecff 100644 --- a/common/dfx_utils/test/unittest/BUILD.gn +++ b/common/dfx_utils/test/unittest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/common/include/daudio_constants.h b/common/include/daudio_constants.h index 3c08ddb1991314f08aa40870624ca18eb45e61bb..4c06b3d55f9606936d0595db484aa711dc6bf45d 100644 --- a/common/include/daudio_constants.h +++ b/common/include/daudio_constants.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/common/include/daudio_errorcode.h b/common/include/daudio_errorcode.h index 5a141af887ceb647a447b0656561a3e474576a3d..f0672cc071cd007479c56183d99930a0a66ccb72 100644 --- a/common/include/daudio_errorcode.h +++ b/common/include/daudio_errorcode.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h index c3562a1325c77abe402ca62c0ddbb822aaf0f7da..48b282eec2d17031ab2a4e2221dddbd75abd645d 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 @@ -105,21 +105,20 @@ private: AudioDeviceDescriptor devDesc_; AudioSampleAttributes devAttrs_; + std::mutex renderMtx_; + std::mutex volMtx_; + bool firstOpenFlag_ = true; uint32_t timeInterval_ = 5; - float renderSpeed_ = 0; uint32_t currentFrame_ = 0; - std::mutex renderMtx_; + uint32_t vol_ = 0; + uint32_t volMax_ = 0; + uint32_t volMin_ = 0; + int64_t frameIndex_ = 0; + float renderSpeed_ = 0; AudioChannelMode channelMode_ = AUDIO_CHANNEL_NORMAL; AudioRenderStatus renderStatus_ = RENDER_STATUS_CLOSE; sptr audioExtCallback_ = nullptr; sptr renderCallback_ = nullptr; - bool firstOpenFlag_ = true; - - int64_t frameIndex_ = 0; - std::mutex volMtx_; - uint32_t vol_ = 0; - uint32_t volMax_ = 0; - uint32_t volMin_ = 0; }; } // V1_0 } // Audio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_adapter_interface_impl.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_adapter_interface_impl.cpp index 06a7e8ea6b7546980dd7000d0fd1c94f65097138..adf8f2f073c272717346198795501814d9ae4f5a 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_adapter_interface_impl.cpp +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_adapter_interface_impl.cpp @@ -837,11 +837,11 @@ int32_t AudioAdapterInterfaceImpl::HandleDeviceClosed(const DAudioEvent &event) } AudioDeviceDescriptor dec; - if (isSpkOpened_ == true && event.type == HDF_AUDIO_EVENT_SPK_CLOSED) { + if (isSpkOpened_ && event.type == HDF_AUDIO_EVENT_SPK_CLOSED) { DHLOGE("Render device status error, close render."); dec.pins = static_cast(spkPinInUse_); return DestroyRender(dec); - } else if (isMicOpened_ == true && event.type == HDF_AUDIO_EVENT_MIC_CLOSED) { + } else if (isMicOpened_ && event.type == HDF_AUDIO_EVENT_MIC_CLOSED) { DHLOGE("Capture device status error, close capture."); dec.pins = static_cast(micPinInUse_); return DestroyCapture(dec); diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp index a2681d5a500dea6e5f2d59c3b5ea5d94be793545..686196cb5baab271dd9abb95a11bb078457b1e01 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audioclient/micclient/src/dmic_client.cpp b/services/audioclient/micclient/src/dmic_client.cpp index 19b7d8c2d2f6b086bd428537e7e86aee918e3e45..150191fa941be914f69081b7a32e3a4d344a0fc4 100644 --- a/services/audioclient/micclient/src/dmic_client.cpp +++ b/services/audioclient/micclient/src/dmic_client.cpp @@ -60,7 +60,7 @@ int32_t DMicClient::InitSenderEngine(IAVEngineProvider *providerPtr) { DHLOGI("Init SenderEngine"); IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { if (micTrans_ == nullptr) { micTrans_ = std::make_shared(devId_, shared_from_this()); } @@ -129,8 +129,9 @@ int32_t DMicClient::SetUp(const AudioParam ¶m) DHLOGE("Audio capturer create failed."); return ERR_DH_AUDIO_CLIENT_CREATE_CAPTURER_FAILED; } - // old new 方式归一 - if (engineFlag_ == false) { + + // Use a unified process regardless of whether it relies on transport components or not + if (!engineFlag_) { micTrans_ = std::make_shared(devId_); } if (micTrans_ == nullptr) { diff --git a/services/audioclient/spkclient/src/dspeaker_client.cpp b/services/audioclient/spkclient/src/dspeaker_client.cpp index 107f619f77da6f244700f971c2c7d591660c28d3..a1522a99e337dc206b514dc5f1a8a0f46fd1fe15 100644 --- a/services/audioclient/spkclient/src/dspeaker_client.cpp +++ b/services/audioclient/spkclient/src/dspeaker_client.cpp @@ -61,7 +61,7 @@ int32_t DSpeakerClient::InitReceiverEngine(IAVEngineProvider *providerPtr) { DHLOGI("InitReceiverEngine enter."); IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { if (speakerTrans_ == nullptr) { speakerTrans_ = std::make_shared(devId_, shared_from_this()); } @@ -111,7 +111,7 @@ int32_t DSpeakerClient::SetUp(const AudioParam ¶m) DHLOGE("Set up failed, Create Audio renderer failed."); return ret; } - if (engineFlag_ == false) { + if (!engineFlag_) { speakerTrans_ = std::make_shared(devId_); } if (speakerTrans_ == nullptr) { @@ -488,7 +488,7 @@ void DSpeakerClient::Pause() if (renderDataThread_.joinable()) { renderDataThread_.join(); } - // todo pause engine + if (speakerTrans_ == nullptr || speakerTrans_->Pause() != DH_SUCCESS) { DHLOGE("Speaker trans Pause failed."); } @@ -502,7 +502,6 @@ void DSpeakerClient::Pause() void DSpeakerClient::ReStart() { DHLOGI("ReStart"); - // todo pause engine if (speakerTrans_ == nullptr || speakerTrans_->Restart(audioParam_, audioParam_) != DH_SUCCESS) { DHLOGE("Speaker trans Restart failed."); } diff --git a/services/audioclient/test/unittest/audioclienttestutils/include/daudio_test_utils.h b/services/audioclient/test/unittest/audioclienttestutils/include/daudio_test_utils.h index e172743aee5877f5bfb7b20af8c08d57a2215e13..1302a6370674dfd8247c3b7c2792ffb7048b70a7 100644 --- a/services/audioclient/test/unittest/audioclienttestutils/include/daudio_test_utils.h +++ b/services/audioclient/test/unittest/audioclienttestutils/include/daudio_test_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audioclient/test/unittest/micclient/BUILD.gn b/services/audioclient/test/unittest/micclient/BUILD.gn index f9c7c4fcc0dec7bef3dded43f8197e9f49722c5a..aeec741c8fb5ba1f644588a8cbeed5c6372e33bd 100644 --- a/services/audioclient/test/unittest/micclient/BUILD.gn +++ b/services/audioclient/test/unittest/micclient/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audioclient/test/unittest/spkclient/BUILD.gn b/services/audioclient/test/unittest/spkclient/BUILD.gn index 47575fcf4d564e2b878436a9b9b1be620c6f1f7c..190b39ce6ec8e86d3431d8d3e4431d4eab515fd4 100644 --- a/services/audioclient/test/unittest/spkclient/BUILD.gn +++ b/services/audioclient/test/unittest/spkclient/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiocontrol/controlsource/src/daudio_source_dev_ctrl_manager.cpp b/services/audiocontrol/controlsource/src/daudio_source_dev_ctrl_manager.cpp index 3310c5704732973120c87f5fcbebe8dbab1e8c08..ac883fefdfb34202b3ed9b37a26d65d9e94e30c9 100644 --- a/services/audiocontrol/controlsource/src/daudio_source_dev_ctrl_manager.cpp +++ b/services/audiocontrol/controlsource/src/daudio_source_dev_ctrl_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 @@ -69,7 +69,7 @@ int32_t DAudioSourceDevCtrlMgr::Start() std::unique_lock lck(channelWaitMutex_); auto status = channelWaitCond_.wait_for(lck, std::chrono::seconds(CHANNEL_WAIT_SECONDS), - [this]() { return isOpened_.load() == true; }); + [this]() { return isOpened_.load(); }); if (!status) { DHLOGE("Wait channel open timeout(%ds).", CHANNEL_WAIT_SECONDS); return ERR_DH_AUDIO_SA_CTRL_CHANNEL_WAIT_TIMEOUT; diff --git a/services/audiomanager/managersink/include/daudio_sink_dev.h b/services/audiomanager/managersink/include/daudio_sink_dev.h index ed345afa297afaf3753dd9083f54b62b1bbb418d..856736cb51a22e2797f3fd917ef0f5808b2e056c 100644 --- a/services/audiomanager/managersink/include/daudio_sink_dev.h +++ b/services/audiomanager/managersink/include/daudio_sink_dev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiomanager/managersink/src/daudio_sink_dev.cpp b/services/audiomanager/managersink/src/daudio_sink_dev.cpp index 21dc574eb9695acd567edc67623b0fc327f39a19..8400fab3c1c34b6ca5d6122bfc26bfbfa23349ec 100644 --- a/services/audiomanager/managersink/src/daudio_sink_dev.cpp +++ b/services/audiomanager/managersink/src/daudio_sink_dev.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 @@ -81,13 +81,13 @@ void DAudioSinkDev::SleepAudioDev() int32_t DAudioSinkDev::InitAVTransEngines(IAVEngineProvider *senderPtr, IAVEngineProvider *receiverPtr) { DHLOGI("Init InitAVTransEngines"); - if (engineFlag_ == true) { - // new 模式下只支持普通通路;后期音频框架支持后,全部支持 + if (engineFlag_) { + // only supports normal audio channel mode micClient_ = std::make_shared(devId_, shared_from_this()); micClient_->InitSenderEngine(senderPtr); } - if (engineFlag_ == true) { + if (engineFlag_) { speakerClient_ = std::make_shared(devId_, shared_from_this()); speakerClient_->InitReceiverEngine(receiverPtr); } @@ -341,7 +341,7 @@ int32_t DAudioSinkDev::NotifyPlayStatusChange(const AudioEvent &audioEvent) int32_t DAudioSinkDev::TaskOpenCtrlChannel(const std::string &args) { DHLOGI("Open ctrl channel."); - if (engineFlag_ == false) { + if (!engineFlag_) { if (args.length() > DAUDIO_MAX_JSON_LEN || args.empty()) { return ERR_DH_AUDIO_SA_PARAM_INVALID; } @@ -373,7 +373,7 @@ int32_t DAudioSinkDev::TaskOpenCtrlChannel(const std::string &args) int32_t DAudioSinkDev::TaskCloseCtrlChannel(const std::string &args) { (void)args; - if (engineFlag_ == false) { + if (!engineFlag_) { DHLOGD("Close ctrl channel."); if (audioCtrlMgr_ == nullptr) { DHLOGD("Ctrl channel already closed."); @@ -411,12 +411,12 @@ int32_t DAudioSinkDev::TaskOpenDSpeaker(const std::string &args) DHLOGE("Get audio param from json failed, error code %d.", ret); return ret; } - // new mode 下 spkclient应该在初始化就做 - if (engineFlag_ == true && speakerClient_ == nullptr) { + + if (engineFlag_ && speakerClient_ == nullptr) { DHLOGE("speaker client should be init by dev."); return ERR_DH_AUDIO_NULLPTR; } - if (engineFlag_ == false && speakerClient_ == nullptr) { + if (!engineFlag_ && speakerClient_ == nullptr) { #ifdef DAUDIO_SUPPORT_DIRECT if (audioParam.renderOpts.renderFlags == MMAP_MODE) { DHLOGI("Try to mmap mode."); @@ -449,7 +449,7 @@ int32_t DAudioSinkDev::TaskCloseDSpeaker(const std::string &args) DHLOGI("Close speaker device."); if (speakerClient_ == nullptr) { DHLOGE("Speaker client is null or already closed."); - if (engineFlag_ == false) { + if (!engineFlag_) { NotifySourceDev(NOTIFY_CLOSE_SPEAKER_RESULT, spkDhId_, DH_SUCCESS); } return DH_SUCCESS; @@ -467,7 +467,7 @@ int32_t DAudioSinkDev::TaskCloseDSpeaker(const std::string &args) closeStatus = false; } speakerClient_ = nullptr; - if (engineFlag_ == false) { + if (!engineFlag_) { closeStatus ? NotifySourceDev(NOTIFY_CLOSE_SPEAKER_RESULT, spkDhId_, DH_SUCCESS) : NotifySourceDev(NOTIFY_CLOSE_SPEAKER_RESULT, spkDhId_, ERR_DH_AUDIO_FAILED); } @@ -492,11 +492,11 @@ int32_t DAudioSinkDev::TaskOpenDMic(const std::string &args) DHLOGE("Get audio param from json failed, error code %d.", ret); return ret; } - if (engineFlag_ == true && micClient_ == nullptr) { + if (engineFlag_ && micClient_ == nullptr) { DHLOGE("Mic client should be init by dev."); return ERR_DH_AUDIO_NULLPTR; } - if (engineFlag_ == false && micClient_ == nullptr) { + if (!engineFlag_ && micClient_ == nullptr) { #ifdef DAUDIO_SUPPORT_DIRECT if (audioParam.captureOpts.capturerFlags == MMAP_MODE) { DHLOGI("Try to mmap mode."); @@ -533,7 +533,7 @@ int32_t DAudioSinkDev::TaskCloseDMic(const std::string &args) DHLOGI("Close mic device."); if (micClient_ == nullptr) { DHLOGE("Mic client is null or already closed."); - if (engineFlag_ == false) { + if (!engineFlag_) { NotifySourceDev(NOTIFY_CLOSE_MIC_RESULT, micDhId_, DH_SUCCESS); } return DH_SUCCESS; @@ -551,7 +551,7 @@ int32_t DAudioSinkDev::TaskCloseDMic(const std::string &args) closeStatus = false; } micClient_ = nullptr; - if (engineFlag_ == false) { + if (!engineFlag_) { closeStatus ? NotifySourceDev(NOTIFY_CLOSE_MIC_RESULT, micDhId_, DH_SUCCESS) : NotifySourceDev(NOTIFY_CLOSE_MIC_RESULT, micDhId_, ERR_DH_AUDIO_FAILED); } @@ -639,7 +639,7 @@ int32_t DAudioSinkDev::TaskPlayStatusChange(const std::string &args) int32_t DAudioSinkDev::SendAudioEventToRemote(const AudioEvent &event) { - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { DHLOGE("Audio ctrl mgr not init."); return ERR_DH_AUDIO_NULLPTR; @@ -684,7 +684,7 @@ void DAudioSinkDev::NotifySourceDev(const AudioEventType type, const std::string jEvent[KEY_EVENT_TYPE] = type; jEvent[KEY_RANDOM_TASK_CODE] = std::to_string(randomTaskCode); - if (engineFlag_ == false) { + if (!engineFlag_) { DHLOGD("notify source dev, random task code: %s", std::to_string(randomTaskCode).c_str()); DAudioSinkManager::GetInstance().DAudioNotify(devId_, dhId, type, jEvent.dump()); } else { diff --git a/services/audiomanager/managersink/src/daudio_sink_manager.cpp b/services/audiomanager/managersink/src/daudio_sink_manager.cpp index 93a36c373d0ed4ca348eae0deacb20a8ed5b6d3f..fb55364cba232b26d3676959badeaf29b53db9b5 100644 --- a/services/audiomanager/managersink/src/daudio_sink_manager.cpp +++ b/services/audiomanager/managersink/src/daudio_sink_manager.cpp @@ -62,9 +62,9 @@ int32_t DAudioSinkManager::Init() DHLOGE("Get local network id failed, ret: %d.", ret); return ret; } - // new 方式 + IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { ret = LoadAVReceiverEngineProvider(); if (ret != DH_SUCCESS || rcvProviderPtr_ == nullptr) { DHLOGE("Load av transport receiver engine provider failed."); @@ -88,7 +88,7 @@ int32_t DAudioSinkManager::Init() DHLOGE("Register av transport sender Provider Callback failed."); return ERR_DH_AUDIO_FAILED; } - DHLOGE("LoadAVSenderEngineProvider success."); + DHLOGI("LoadAVSenderEngineProvider success."); } return DH_SUCCESS; } @@ -96,7 +96,7 @@ int32_t DAudioSinkManager::Init() int32_t DAudioSinkManager::UnInit() { DHLOGI("UnInit audio sink manager."); - if (engineFlag_ == true) { + if (engineFlag_) { UnloadAVSenderEngineProvider(); UnloadAVReceiverEngineProvider(); } @@ -161,7 +161,7 @@ int32_t DAudioSinkManager::HandleDAudioNotify(const std::string &devId, const st int32_t DAudioSinkManager::CreateAudioDevice(const std::string &devId) { DHLOGI("Create audio sink dev."); - if (engineFlag_ == true) { + if (engineFlag_) { std::lock_guard lock(devMapMutex_); if (audioDevMap_.find(devId) != audioDevMap_.end()) { DHLOGI("Audio sink dev in map. devId: %s.", GetAnonyString(devId).c_str()); @@ -173,7 +173,7 @@ int32_t DAudioSinkManager::CreateAudioDevice(const std::string &devId) DHLOGE("Awake audio dev failed."); return ERR_DH_AUDIO_FAILED; } - if (engineFlag_ == true) { + if (engineFlag_) { int32_t ret = dev->InitAVTransEngines(sendProviderPtr_, rcvProviderPtr_); if (ret != DH_SUCCESS) { DHLOGE("Init av transport sender engine failed."); @@ -269,7 +269,7 @@ int32_t DAudioSinkManager::LoadAVReceiverEngineProvider() return ERR_DH_AUDIO_TRANS_NULL_VALUE; } rcvProviderPtr_ = getEngineFactoryFunc(OWNER_NAME_D_SPEAKER); - DHLOGE("LoadAVReceiverEngineProvider success"); + DHLOGE("LoadAVReceiverEngineProvider success."); return DH_SUCCESS; } diff --git a/services/audiomanager/managersource/include/daudio_source_dev.h b/services/audiomanager/managersource/include/daudio_source_dev.h index 87e0ecb476ed900abcf8e742cb3957ec3c69c427..cf6340d89470384b7ddc4261b082e2442e7b202b 100644 --- a/services/audiomanager/managersource/include/daudio_source_dev.h +++ b/services/audiomanager/managersource/include/daudio_source_dev.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiomanager/managersource/src/daudio_source_dev.cpp b/services/audiomanager/managersource/src/daudio_source_dev.cpp index da1f947d963d7b6df36f47942a3157f9b0505fa3..5463adc01fbb17c5219a6532c33acdc72a8f3413 100644 --- a/services/audiomanager/managersource/src/daudio_source_dev.cpp +++ b/services/audiomanager/managersource/src/daudio_source_dev.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 @@ -223,7 +223,7 @@ int32_t DAudioSourceDev::HandleDMicClosed(const AudioEvent &event) int32_t DAudioSourceDev::OpenCtrlTrans(const AudioEvent &event) { - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { audioCtrlMgr_ = std::make_shared(devId_, shared_from_this()); } @@ -237,7 +237,7 @@ int32_t DAudioSourceDev::OpenCtrlTrans(const AudioEvent &event) int32_t DAudioSourceDev::CloseCtrlTrans(const AudioEvent &event, bool isSpk) { - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { DHLOGD("Ctrl already closed."); return DH_SUCCESS; @@ -600,7 +600,7 @@ int32_t DAudioSourceDev::TaskOpenDSpeaker(const std::string &args) return ERR_DH_AUDIO_FAILED; } - if (engineFlag_ == true) { + if (engineFlag_) { int32_t ret = speaker_->InitSenderEngine(DAudioSourceManager::GetInstance().getSenderProvider()); if (ret != DH_SUCCESS) { DHLOGE("Speaker init sender Engine, error code %d.", ret); @@ -699,7 +699,7 @@ int32_t DAudioSourceDev::TaskCloseDSpeaker(const std::string &args) DHLOGD("args length error."); return ERR_DH_AUDIO_SA_PARAM_INVALID; } - int32_t ret = engineFlag_ == false ? CloseSpkOld(args) : CloseSpkNew(args); + int32_t ret = !engineFlag_ ? CloseSpkOld(args) : CloseSpkNew(args); if (ret != DH_SUCCESS) { DHLOGE("Close spk in old mode failed."); return ret; @@ -715,7 +715,7 @@ int32_t DAudioSourceDev::TaskOpenDMic(const std::string &args) DHLOGE("Mic device not init"); return ERR_DH_AUDIO_SA_MIC_DEVICE_NOT_INIT; } - if (engineFlag_ == true) { + if (engineFlag_) { int32_t ret = mic_->InitReceiverEngine(DAudioSourceManager::GetInstance().getReceiverProvider()); if (ret != DH_SUCCESS) { DHLOGE("Init receiver engine failed."); @@ -823,7 +823,7 @@ int32_t DAudioSourceDev::TaskCloseDMic(const std::string &args) if (args.length() > DAUDIO_MAX_JSON_LEN || args.empty()) { return ERR_DH_AUDIO_SA_PARAM_INVALID; } - int32_t ret = engineFlag_ == false ? CloseMicOld(args): CloseMicNew(args); + int32_t ret = !engineFlag_ ? CloseMicOld(args): CloseMicNew(args); if (ret != DH_SUCCESS) { DHLOGE("Task close mic error."); return ret; @@ -835,7 +835,7 @@ int32_t DAudioSourceDev::TaskCloseDMic(const std::string &args) int32_t DAudioSourceDev::TaskOpenCtrlChannel(const std::string &args) { DHLOGI("Task open ctrl channel, args: %s.", args.c_str()); - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { DHLOGE("Audio source ctrl mgr not init."); return ERR_DH_AUDIO_NULLPTR; @@ -878,7 +878,7 @@ int32_t DAudioSourceDev::TaskOpenCtrlChannel(const std::string &args) int32_t DAudioSourceDev::TaskCloseCtrlChannel(const std::string &args) { DHLOGI("Task close ctrl channel, args: %s.", args.c_str()); - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { DHLOGD("Audio source ctrl magr already closed."); return DH_SUCCESS; @@ -960,7 +960,7 @@ int32_t DAudioSourceDev::TaskPlayStatusChange(const std::string &args) int32_t DAudioSourceDev::SendAudioEventToRemote(const AudioEvent &event) { - if (engineFlag_ == false) { + if (!engineFlag_) { if (audioCtrlMgr_ == nullptr) { DHLOGE("Audio ctrl mgr not init."); return ERR_DH_AUDIO_NULLPTR; @@ -1055,7 +1055,7 @@ int32_t DAudioSourceDev::NotifySinkDev(const AudioEventType type, const json Par { KEY_AUDIO_PARAM, Param }, { KEY_RANDOM_TASK_CODE, std::to_string(randomTaskCode) } }; DHLOGD("Notify sink dev, random task code: %s", std::to_string(randomTaskCode).c_str()); - if (engineFlag_ == false) { + if (!engineFlag_) { DAudioSourceManager::GetInstance().DAudioNotify(devId_, dhId, type, jParam.dump()); } else { DHLOGD("Notify sink dev, new engine, random task code:%s", std::to_string(randomTaskCode).c_str()); diff --git a/services/audiomanager/managersource/src/daudio_source_manager.cpp b/services/audiomanager/managersource/src/daudio_source_manager.cpp index 0c074e4b5be4fb5faf47f2e873c3abd2cd35a4de..09dcb92bc08c5f638f4f070a57c786d3837eb653 100644 --- a/services/audiomanager/managersource/src/daudio_source_manager.cpp +++ b/services/audiomanager/managersource/src/daudio_source_manager.cpp @@ -78,7 +78,7 @@ int32_t DAudioSourceManager::Init(const sptr &callback) ipcCallback_ = callback; daudioMgrCallback_ = std::make_shared(); IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { int32_t ret = LoadAVSenderEngineProvider(); if (ret != DH_SUCCESS) { DHLOGE("load av transport sender engine provider failed"); @@ -96,7 +96,7 @@ int32_t DAudioSourceManager::Init(const sptr &callback) int32_t DAudioSourceManager::UnInit() { DHLOGI("Uninit audio source manager."); - if (engineFlag_ == true) { + if (engineFlag_) { UnloadAVReceiverEngineProvider(); UnloadAVSenderEngineProvider(); } diff --git a/services/audiomanager/managersource/src/dmic_dev.cpp b/services/audiomanager/managersource/src/dmic_dev.cpp index f2f0d4993781286b4dd96ad1ef8845f1c546eabf..d5626693723147a9226c5d6ccd233c257e476571 100644 --- a/services/audiomanager/managersource/src/dmic_dev.cpp +++ b/services/audiomanager/managersource/src/dmic_dev.cpp @@ -66,9 +66,8 @@ void DMicDev::OnEngineTransDataAvailable(const std::shared_ptr &audio int32_t DMicDev::InitReceiverEngine(IAVEngineProvider *providerPtr) { DHLOGI("InitReceiverEngine enter."); - // new 方式 IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { if (micTrans_ == nullptr) { micTrans_ = std::make_shared(devId_, shared_from_this()); } @@ -234,14 +233,13 @@ int32_t DMicDev::NotifyEvent(const std::string &devId, const int32_t dhId, const int32_t DMicDev::SetUp() { DHLOGI("Set up mic device."); - if (engineFlag_ == false) { + if (!engineFlag_) { micTrans_ = std::make_shared(devId_); - } else { - if (micTrans_ == nullptr) { - DHLOGE("mic trans should be init by dev."); - return ERR_DH_AUDIO_NULLPTR; - } + } else if (micTrans_ == nullptr) { + DHLOGE("mic trans should be init by dev."); + return ERR_DH_AUDIO_NULLPTR; } + int32_t ret = micTrans_->SetUp(param_, param_, shared_from_this(), CAP_MIC); if (ret != DH_SUCCESS) { DHLOGE("Mic trans set up failed. ret: %d.", ret); diff --git a/services/audiomanager/managersource/src/dspeaker_dev.cpp b/services/audiomanager/managersource/src/dspeaker_dev.cpp index 1abe3c1bd4b5daacc86c7ac5db95b25eb6994cad..3152d3c28e4e86be6e37f63e63ce5835fbef1dda 100644 --- a/services/audiomanager/managersource/src/dspeaker_dev.cpp +++ b/services/audiomanager/managersource/src/dspeaker_dev.cpp @@ -104,9 +104,8 @@ int32_t DSpeakerDev::DisableDevice(const int32_t dhId) int32_t DSpeakerDev::InitSenderEngine(IAVEngineProvider *providerPtr) { DHLOGI("InitSenderEngine enter"); - // new 方式 IsParamEnabled(AUDIO_ENGINE_FLAG, engineFlag_); - if (engineFlag_ == true) { + if (engineFlag_) { if (speakerTrans_ == nullptr) { speakerTrans_ = std::make_shared(devId_, shared_from_this()); } diff --git a/services/audiomanager/servicesink/BUILD.gn b/services/audiomanager/servicesink/BUILD.gn index e8746b3a7c3af3f70a57a687d4d07257e2c4c46f..835f8816327f1b7011c3fcc7d1de7afe3586fa43 100755 --- a/services/audiomanager/servicesink/BUILD.gn +++ b/services/audiomanager/servicesink/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/servicesource/BUILD.gn b/services/audiomanager/servicesource/BUILD.gn index 790797bc23bfa8c722a0c8ad2356a8aad7ba6b00..53e3d26a09df8c6f848937b9bcc68b8d1ed2888e 100755 --- a/services/audiomanager/servicesource/BUILD.gn +++ b/services/audiomanager/servicesource/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h b/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h index 65119d11f2599b62d100c0aa4a3d27944517a05f..57e9235885118947e1756895c04a9859588910fa 100644 --- a/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h +++ b/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiomanager/test/unittest/managersink/BUILD.gn b/services/audiomanager/test/unittest/managersink/BUILD.gn index cd6f8b4fa7bd41cc497d5c2f4569e0ed6fac04e6..6e4d28ec89e531416bf0445e32f332dda787c592 100644 --- a/services/audiomanager/test/unittest/managersink/BUILD.gn +++ b/services/audiomanager/test/unittest/managersink/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/test/unittest/servicesink/BUILD.gn b/services/audiomanager/test/unittest/servicesink/BUILD.gn index aafc39602e11b825d0d4d6bdd8c90248400e0518..22218c4602454e062d270dc6810a94d484685c13 100644 --- a/services/audiomanager/test/unittest/servicesink/BUILD.gn +++ b/services/audiomanager/test/unittest/servicesink/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/test/unittest/servicesource/BUILD.gn b/services/audiomanager/test/unittest/servicesource/BUILD.gn index 577ba29971df009969023175269f8014d15b84af..92f83870ff080375172ee494105738c015dee6cc 100644 --- a/services/audiomanager/test/unittest/servicesource/BUILD.gn +++ b/services/audiomanager/test/unittest/servicesource/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/test/unittest/sourcedevice/BUILD.gn b/services/audiomanager/test/unittest/sourcedevice/BUILD.gn index 22d6de7c650699795b0437354a3a83741248610d..0caca862d8677f421588c5f5dfc5d66679dadf18 100644 --- a/services/audiomanager/test/unittest/sourcedevice/BUILD.gn +++ b/services/audiomanager/test/unittest/sourcedevice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiomanager/test/unittest/sourcemanager/BUILD.gn b/services/audiomanager/test/unittest/sourcemanager/BUILD.gn index 5bc08fcfc5a73ecf6217bbf423e5fabb0e18ee21..fe5139cf0615eb9ca4550e9491d40487ddd8b111 100644 --- a/services/audiomanager/test/unittest/sourcemanager/BUILD.gn +++ b/services/audiomanager/test/unittest/sourcemanager/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiotransport/decodetransport/BUILD.gn b/services/audiotransport/decodetransport/BUILD.gn index 6c305a5d1a582e6959c7aea8852e963d955b7d51..bc26bcfea0aa41a36330930368804971db16b782 100644 --- a/services/audiotransport/decodetransport/BUILD.gn +++ b/services/audiotransport/decodetransport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiotransport/decodetransport/include/audio_decode_transport.h b/services/audiotransport/decodetransport/include/audio_decode_transport.h index 1b675a1bdb25bcb509ec44d724d5100c17338726..180590e56134eeaf8dfd21d750afe0280181f4e9 100644 --- a/services/audiotransport/decodetransport/include/audio_decode_transport.h +++ b/services/audiotransport/decodetransport/include/audio_decode_transport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiotransport/decodetransport/src/audio_decode_transport.cpp b/services/audiotransport/decodetransport/src/audio_decode_transport.cpp index 83fd38095f849e7a85e817b767fcad35a93f4170..88c600e0f16ef0c282f4f2883530a9ebb838f5b0 100644 --- a/services/audiotransport/decodetransport/src/audio_decode_transport.cpp +++ b/services/audiotransport/decodetransport/src/audio_decode_transport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiotransport/encodetransport/BUILD.gn b/services/audiotransport/encodetransport/BUILD.gn index d8ffda2ba4b7f05ed9c1ca86e89d2f2e7d75d501..bc75f76f114c43c4f9e47acec0cf81458cc4680e 100644 --- a/services/audiotransport/encodetransport/BUILD.gn +++ b/services/audiotransport/encodetransport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiotransport/encodetransport/include/audio_encode_transport.h b/services/audiotransport/encodetransport/include/audio_encode_transport.h index 3aabe6b807a6293e955179d0da94c40ffda53bc9..52397b3152f35f14b608bcebbd46eec752188e7f 100644 --- a/services/audiotransport/encodetransport/include/audio_encode_transport.h +++ b/services/audiotransport/encodetransport/include/audio_encode_transport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiotransport/encodetransport/src/audio_encode_transport.cpp b/services/audiotransport/encodetransport/src/audio_encode_transport.cpp index 84256bebe29b6df8754af1ae39886ebf6db57e16..f8eeb4328d1bce046f321cae870a7070208ad2a2 100644 --- a/services/audiotransport/encodetransport/src/audio_encode_transport.cpp +++ b/services/audiotransport/encodetransport/src/audio_encode_transport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiotransport/interface/iaudio_data_transport.h b/services/audiotransport/interface/iaudio_data_transport.h index c90ccf1c2734ecfede5d4aca113e8a04f1ede5bb..406e90796713421ed7c4d1b522a0f9d0506349db 100644 --- a/services/audiotransport/interface/iaudio_data_transport.h +++ b/services/audiotransport/interface/iaudio_data_transport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * 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 diff --git a/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp b/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp index 39a09be9608d0ae800a386cbb456b08219a4eb30..ff0b7c8ec70c75ba651de1dddcb805245ada7d63 100644 --- a/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp +++ b/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp @@ -113,14 +113,12 @@ int32_t AVTransReceiverTransport::Release() return DH_SUCCESS; } -// todo pause int32_t AVTransReceiverTransport::Pause() { DHLOGI("Pause ReceiverEngine enter."); return DH_SUCCESS; } -// todo restart int32_t AVTransReceiverTransport::Restart(const AudioParam &localParam, const AudioParam &remoteParam) { DHLOGI("ReStart ReceiverEngine enter."); diff --git a/services/audiotransport/senderengine/src/av_sender_engine_transport.cpp b/services/audiotransport/senderengine/src/av_sender_engine_transport.cpp index 0a3e7db568ef12b3fee2bb4d0d273f2793fd6b20..61117b308e7226ec025555f45880d5d7a3a21cc5 100644 --- a/services/audiotransport/senderengine/src/av_sender_engine_transport.cpp +++ b/services/audiotransport/senderengine/src/av_sender_engine_transport.cpp @@ -98,14 +98,12 @@ int32_t AVTransSenderTransport::Stop() return DH_SUCCESS; } -// todo pause int32_t AVTransSenderTransport::Pause() { DHLOGI("PauseSenderEngine enter."); return DH_SUCCESS; } -// todo restart int32_t AVTransSenderTransport::Restart(const AudioParam &localParam, const AudioParam &remoteParam) { DHLOGI("RestartSenderEngine enter."); diff --git a/services/audiotransport/test/unittest/decodetransport/BUILD.gn b/services/audiotransport/test/unittest/decodetransport/BUILD.gn index daf584635906a7a722b475487071fa09ee874d60..75cefc1b483324fd954435803d5e50f8e7189057 100644 --- a/services/audiotransport/test/unittest/decodetransport/BUILD.gn +++ b/services/audiotransport/test/unittest/decodetransport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/audiotransport/test/unittest/encodetransport/BUILD.gn b/services/audiotransport/test/unittest/encodetransport/BUILD.gn index c27d5001e6c68602284b93b84aa1db37f4ea408e..22e4b5744ee3d695a097bb7ec655d4be420cbb0b 100644 --- a/services/audiotransport/test/unittest/encodetransport/BUILD.gn +++ b/services/audiotransport/test/unittest/encodetransport/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # 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 diff --git a/services/hdfaudioclient/src/distributed_audio_client.cpp b/services/hdfaudioclient/src/distributed_audio_client.cpp index 453a9707dc982b7434cdfbf605a1ccad4bdd71de..703a47f59c611685ce04e1244b7fc74d6dbfe0ab 100644 --- a/services/hdfaudioclient/src/distributed_audio_client.cpp +++ b/services/hdfaudioclient/src/distributed_audio_client.cpp @@ -288,7 +288,7 @@ extern "C" { struct AudioManager *GetAudioManagerFuncs(void) { - if (OHOS::DistributedHardware::AudioManagerInit() == true) { + if (OHOS::DistributedHardware::AudioManagerInit()) { return &OHOS::DistributedHardware::g_AudioManagerContext.instance_; } else { return nullptr;