diff --git a/frameworks/native/audioutils/BUILD.gn b/frameworks/native/audioutils/BUILD.gn index 34e8ab75fe5c1e43bc1856af25bc004db8494b1d..16804474491836f14033366252902a35af7230d6 100644 --- a/frameworks/native/audioutils/BUILD.gn +++ b/frameworks/native/audioutils/BUILD.gn @@ -84,6 +84,10 @@ ohos_shared_library("audio_utils") { defines += [ "AUDIO_BUILD_VARIANT_ROOT" ] } + if (!audio_framework_feature_new_engine_flag) { + defines += [ "SUPPORT_OLD_ENGINE" ] + } + subsystem_name = "multimedia" innerapi_tags = [ "platformsdk_indirect" ] part_name = "audio_framework" diff --git a/frameworks/native/audioutils/src/audio_utils.cpp b/frameworks/native/audioutils/src/audio_utils.cpp index f9e6e6d357340ed22fe221931b5e61b4b9bc7577..ae5a0d4fb0f98d89e31d8a2130166dd10f37f3c9 100644 --- a/frameworks/native/audioutils/src/audio_utils.cpp +++ b/frameworks/native/audioutils/src/audio_utils.cpp @@ -1164,6 +1164,7 @@ template bool GetSysPara(const char *key, std::string &value); int32_t GetEngineFlag() { +#ifdef SUPPORT_OLD_ENGINE std::string para = "const.multimedia.audio.proaudioEnable"; static int32_t engineFlag = -1; if (engineFlag == -1) { @@ -1172,6 +1173,9 @@ int32_t GetEngineFlag() CHECK_AND_RETURN_RET_LOG(res, engineFlag, "get %{public}s fail", para.c_str()); } return engineFlag; +#else + return 1; +#endif } std::map DumpFileUtil::g_lastPara = {};