blob: bd351576052a07aa0deeb4e5b26d07ea3fd4b9b4 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* MediaTek Inc. (C) 2016. All rights reserved.
2 *
3 * Copyright Statement:
4 * This software/firmware and related documentation ("MediaTek Software") are
5 * protected under relevant copyright laws. The information contained herein is
6 * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
7 * the prior written permission of MediaTek inc. and/or its licensors, any
8 * reproduction, modification, use or disclosure of MediaTek Software, and
9 * information contained herein, in whole or in part, shall be strictly
10 * prohibited.
11 */
12
13/*
14 * Description:
15 * Explor all private AudioParamParser APIs
16 */
17
18#include "AudioParamParser.h"
19#include <math.h>
20
21#ifdef WIN32
22#ifdef __cplusplus
23#define EXPORT extern "C" __declspec(dllexport)
24#else
25#define EXPORT __declspec(dllexport)
26#endif
27#include <process.h>
28#include <Windows.h>
29#include <direct.h>
30#else /* WIN32*/
31#define EXPORT
32#ifdef __cplusplus
33extern "C" {
34#endif
35#include <errno.h>
36#include <sys/stat.h>
37#include <sys/inotify.h>
38#include <unistd.h>
39#include <utils/Timers.h>
40#include <cutils/properties.h>
41#if defined(MTK_YOCTO_AUDIO)
42#include <signal.h>
43#endif
44#endif
45
46#ifdef __linux__
47#define FOLDER "/"
48#else
49#define FOLDER "\\"
50#endif
51
52#define MAX_PROP_VALUE_LEN (512)
53
54#define PROPERTY_KEY_APP_LOG_LEVEL "vendor.audio.applog.level"
55#define PROPERTY_KEY_XML_DEF_PATH "persist.vendor.audio.tuning.def_path"
56
57extern FILE *appLogFp;
58extern int outputLogToStdout;
59
60#ifdef WIN32
61#define ERR_LOG(format, ...) \
62 if(appDebugLevel <= ERR_LEVEL) \
63 utilLog("ERROR[%d,%d](): %s(), " format"\n^^^^\n", _getpid(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__)
64
65#define WARN_LOG(format, ...) \
66 if(appDebugLevel <= WARN_LEVEL) \
67 utilLog("WARNING[%d,%d]: %s(), " format, _getpid(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__)
68
69#define INFO_LOG(format, ...) \
70 if(appDebugLevel <= INFO_LEVEL) \
71 utilLog("INFO[%d,%d]: %s(), " format, _getpid(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__)
72
73#define DEBUG_LOG(format, ...) \
74 if(appDebugLevel <= DEBUG_LEVEL) \
75 utilLog("DEBUG[%d,%d]: %s(), " format, _getpid(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__)
76
77#define MUST_LOG(format, ...) \
78 utilLog("INFO[%d,%d]: %s(), " format, _getpid(), GetCurrentThreadId(), __FUNCTION__, __VA_ARGS__)
79
80#define APP_SIZE_T_FT "%lu"
81#define snprintf _snprintf
82#else /* WIN32 */
83#undef LOG_TAG
84#if defined(SYS_IMPL)
85#define LOG_TAG "AudioParamParser-sys"
86#else
87#define LOG_TAG "AudioParamParser-vnd"
88#endif
89
90#include <utils/Log.h>
91
92#define ERR_LOG(format, args...) \
93 if(appDebugLevel <= ERR_LEVEL) \
94 ALOGE("%s(), " format, __FUNCTION__, ##args)
95
96#define WARN_LOG(format, args...) \
97 if(appDebugLevel <= WARN_LEVEL) \
98 ALOGW("%s(), " format, __FUNCTION__, ##args)
99
100#define INFO_LOG(format, args...) \
101 if(appDebugLevel <= INFO_LEVEL) \
102 ALOGI("%s(), " format, __FUNCTION__, ##args)
103
104#define DEBUG_LOG(format, args...) \
105 if(appDebugLevel <= DEBUG_LEVEL) \
106 ALOGD("%s(), " format, __FUNCTION__, ##args)
107
108#define MUST_LOG(format, args...) \
109 ALOGD("%s(), " format, __FUNCTION__, ##args)
110
111#define APP_SIZE_T_FT "%zu"
112#endif
113
114struct _CategoryPathRetrievedParam {
115AudioType *audioType;
116xmlNodePtr paramTreeNode;
117xmlNodePtr paramUnitPoolNode;
118size_t paramIdCounter;
119};
120typedef struct _CategoryPathRetrievedParam CategoryPathRetrievedParam;
121
122typedef void(*CATEGORY_PATH_RETRIEVED_CB_FUN)(const char *categoryPath, const char *fullCategoryPath, CategoryPathRetrievedParam *categoryPathRetrievedParam);
123
124/* Force adding following category group info and bypass categoryGroup path checking */
125static const char *HARD_CATEGORY_GROUP[][3] = {
126/* {AudioTypeName, CategoryTypeName, CategoryGroupName} */
127{"Speech", "Band", "NB"},
128{"Speech", "Band", "WB"},
129{NULL, NULL, NULL}
130};
131
132/***********************
133 * Public API
134 **********************/
135EXPORT int appSetAudioTypeLoadingList(const char *audioTypeLoadingList[]);
136EXPORT const char *appGetAudioTypeLoadingList(void);
137
138EXPORT void appSetDebugLevel(MSG_LEVEL level);
139EXPORT MSG_LEVEL appGetDebugLevel(void);
140
141EXPORT char **appGetXmlDirFromProperty(void);
142
143/* appHandle API */
144EXPORT APP_STATUS appHandleInit(AppHandle *appHandle);
145EXPORT APP_STATUS appHandleUninit(AppHandle *appHandle);
146EXPORT void appHandleRedirectIOToConsole(void);
147EXPORT AppHandle *appHandleGetInstance(void); /* Never uninit global instance */
148EXPORT size_t appHandleGetNumOfAudioType(AppHandle *appHandle);
149EXPORT AudioType *appHandleGetAudioTypeByIndex(AppHandle *appHandle, size_t index);
150EXPORT AudioType *appHandleGetAudioTypeByName(AppHandle *appHandle, const char *name);
151EXPORT const char *appHandleGetFeatureOptionValue(AppHandle *appHandle, const char *featureOptionName);
152EXPORT int appHandleIsFeatureOptionEnabled(AppHandle *appHandle, const char *featureOptionName);
153EXPORT size_t appHandleGetNumOfFeatureOption(AppHandle *appHandle);
154EXPORT FeatureOption *appHandleGetFeatureOptionByIndex(AppHandle *appHandle, size_t index);
155EXPORT const char *appHandleGetBuildTimeStamp();
156EXPORT APP_STATUS appHandleCompressFiles(const char *srcDir, const char *destFile);
157EXPORT APP_STATUS appHandleUncompressFile(const char *srcFile, const char *destDir);
158EXPORT void appHandleCustXmlEnableChanged(AppHandle *appHandle, int enable);
159
160/* Following 4 APIs will acquire app handle write lock automatically */
161EXPORT APP_STATUS appHandleParseXml(AppHandle *appHandle, const char *dir[], const char *cusDir);
162EXPORT APP_STATUS appHandleReloadAudioType(AppHandle *appHandle, const char *audioTypeName);
163EXPORT void appHandleRegXmlChangedCb(AppHandle *appHandle, NOTIFY_CB_FUN nofiyCallback);
164EXPORT void appHandleUnregXmlChangedCb(AppHandle *appHandle, NOTIFY_CB_FUN nofiyCallback);
165
166/* AudioType API */
167EXPORT APP_STATUS audioTypeIsTuningToolSupportedXmlVer(AudioType *audioType);
168EXPORT APP_STATUS audioTypeIsDeviceSupportedXmlVer(AudioType *audioType);
169EXPORT size_t audioTypeGetNumOfCategoryType(AudioType *audioType);
170EXPORT CategoryType *audioTypeGetCategoryTypeByIndex(AudioType *audioType, size_t idnex);
171EXPORT CategoryType *audioTypeGetCategoryTypeByName(AudioType *audioType, const char *categoryTypeName);
172EXPORT CategoryType *audioTypeGetCategoryTypeByWording(AudioType *audioType, const char *categoryTypeWording);
173EXPORT xmlNode *audioTypeGetCategoryTypeListNode(AudioType *audioType);
174EXPORT ParamUnit *audioTypeGetParamUnit(AudioType *audioType, const char *categoryPath);
175EXPORT size_t audioTypeGetNumOfParamInfo(AudioType *audioType);
176EXPORT ParamInfo *audioTypeGetParamInfoByIndex(AudioType *audioType, size_t index);
177EXPORT ParamInfo *audioTypeGetParamInfoByName(AudioType *audioType, const char *paramName);
178EXPORT APP_STATUS audioTypeSaveAudioParamXml(AudioType *audioType, const char *saveDir, int clearDirtyBit);
179EXPORT int audioTypeReadLock(AudioType *audioType, const char *callerFun);
180EXPORT int audioTypeWriteLock(AudioType *audioType, const char *callerFun);
181EXPORT int audioTypeUnlock(AudioType *audioType);
182EXPORT TreeRoot *audioTypeGetTreeRoot(AudioType *audioType, const char *treeRootName);
183
184/* Following 3 write APIs will acquire write lock automatically */
185EXPORT APP_STATUS audioTypeSetParamData(AudioType *audioType, const char *categoryPath, ParamInfo *paramName, void *dataPtr, int arraySize);
186EXPORT APP_STATUS audioTypeSetFieldData(AudioType *audioType, const char *categoryPath, FieldInfo *fieldInfo, unsigned int val);
187EXPORT APP_STATUS audioTypeParamUnitCopy(AudioType *audioType, const char *srcCategoryPath, const char *dstCategoryPath);
188
189/* CategoryType API */
190EXPORT size_t categoryTypeGetNumOfCategoryGroup(CategoryType *categoryType);
191EXPORT CategoryGroup *categoryTypeGetCategoryGroupByIndex(CategoryType *categoryType, size_t index);
192EXPORT CategoryGroup *categoryTypeGetCategoryGroupByWording(CategoryType *categoryType, const char *wording);
193EXPORT size_t categoryTypeGetNumOfCategory(CategoryType *categoryType);
194EXPORT Category *categoryTypeGetCategoryByIndex(CategoryType *categoryType, size_t index);
195EXPORT Category *categoryTypeGetCategoryByWording(CategoryType *categoryType, const char *wording);
196
197/* CategoryGroup API */
198EXPORT size_t categoryGroupGetNumOfCategory(CategoryGroup *categoryGroup);
199EXPORT Category *categoryGroupGetCategoryByIndex(CategoryGroup *categoryGroup, size_t index);
200EXPORT Category *categoryGroupGetCategoryByWording(CategoryGroup *categoryGroup, const char *index);
201
202/* CategoryAlias API */
203EXPORT CategoryAlias *categoryAliasCreate(const char *alias, Category *category);
204EXPORT void categoryAliasRelease(CategoryAlias *categoryAlias);
205
206/* ParamInfo API */
207EXPORT size_t paramInfoGetNumOfFieldInfo(ParamInfo *paramInfo);
208EXPORT FieldInfo *paramInfoGetFieldInfoByIndex(ParamInfo *paramInfo, size_t index);
209EXPORT FieldInfo *paramInfoGetFieldInfoByName(ParamInfo *paramInfo, const char *fieldName);
210EXPORT char *paramNewDataStr(Param *param);
211EXPORT char *paramNewDataStrWithMode(Param *param, int uArrayHexMode);
212
213/* ParamUnit API */
214EXPORT size_t paramUnitGetNumOfParam(ParamUnit *paramUnit);
215EXPORT Param *paramUnitGetParamByIndex(ParamUnit *paramUnit, size_t index);
216EXPORT Param *paramUnitGetParamByName(ParamUnit *paramUnit, const char *paramName);
217EXPORT ParamInfo *paramUnitGetParamInfo(ParamUnit *paramUnit, const char *paramInfoName);
218EXPORT FieldInfo *paramUnitGetFieldInfo(ParamUnit *paramUnit, const char *paramName, const char *fieldName);
219EXPORT APP_STATUS paramUnitGetFieldVal(ParamUnit *paramUnit, const char *paramName, const char *fieldName, unsigned int *val);
220
221/* Param API */
222EXPORT size_t paramGetArraySizeFromString(const char *str);
223EXPORT size_t paramGetNumOfBytes(Param* param);
224EXPORT APP_STATUS paramGetFieldVal(Param *param, FieldInfo *fieldInfo, unsigned int *val);
225EXPORT APP_STATUS paramSetFieldVal(Param *param, FieldInfo *fieldInfo, unsigned int val);
226EXPORT DATA_TYPE paramDataTypeToEnum(const char *dataType);
227EXPORT const char *paramDataTypeToStr(DATA_TYPE dataType);
228
229/* Field API */
230EXPORT APP_STATUS fieldInfoGetCheckListValue(FieldInfo *fieldInfo, const char *checkName, unsigned int *checkVal);
231
232/* TreeRoot API */
233EXPORT Feature *treeRootGetFeatureByName(TreeRoot *treeRoot, const char *featureName);
234EXPORT int featureIsCategoryPathSupport(Feature *feature, const char *categoryPath);
235
236/* Xml Node related APIs */
237EXPORT xmlNode *findXmlNodeByElemName(xmlNode *node, const char *elemName);
238EXPORT xmlChar *xmlNodeGetProp(xmlNode *node, const char *prop);
239EXPORT xmlChar *xmlNodeGetWording(xmlNode *node);
240
241/* Utils APIs */
242EXPORT APP_STATUS utilConvDataStringToNative(DATA_TYPE dataType, const char *paramDataStr, void **paramData, size_t *arraySize);
243
244/* Unit test */
245EXPORT APP_STATUS unitTest(AppHandle *appHandle);
246EXPORT char *utilGetStdin(char *buf, int bufSize);
247
248/* Following APIs is designed for EM tool integration */
249EXPORT APP_STATUS utilNativeSetField(const char *audioTypeName, const char *categoryPath, const char *paramName, const char *fieldName, const char *fieldValueStr);
250EXPORT APP_STATUS utilNativeSetParam(const char *audioTypeName, const char *categoryPath, const char *paramName, const char *paramDataStr);
251EXPORT char *utilNativeGetCategory(const char *audioTypeName, const char *categoryTypeName);
252EXPORT char *utilNativeGetParam(const char *audioTypeName, const char *categoryPath, const char *paramName);
253EXPORT unsigned int utilNativeGetField(const char *audioTypeName, const char *categoryPath, const char *paramName, const char *fieldName);
254EXPORT APP_STATUS utilNativeSaveXml(const char *audioTypeName);
255EXPORT const char *utilNativeGetChecklist(const char *audioTypeName, const char *paramName, const char *fieldName);
256
257/***********************
258 * Private APIs
259 **********************/
260/* appHandle API */
261EXPORT APP_STATUS appHandleLoadDirAudioTypeInfo(AppHandle *appHandle);
262EXPORT APP_STATUS appHandleLoadAllAudioTypeXml(AppHandle *appHandle);
263EXPORT APP_STATUS appHandleLoadAudioTypeXml(AppHandle *appHandle, AudioType *audioType);
264EXPORT APP_STATUS appHandleReleaseAllAudioTypeXml(AppHandle *appHandle);
265EXPORT int appHandleIsValidAudioType(AppHandle *appHandle, const char *audioType);
266EXPORT AudioType *appHandleAddAudioType(AppHandle *appHandle, const char *audioType);
267EXPORT AudioType *appHandleGetAudioType(AppHandle *appHandle, size_t index);
268EXPORT void appHandleReleaseAudioTypeHash(AppHandle *appHandle);
269EXPORT APP_STATUS appHandleLoadDirFeatureOptionsInfo(AppHandle *appHandle);
270EXPORT void appHandleReleaseFeatureOptionsHash(AppHandle *appHandle);
271EXPORT void appHandleDumpAudioTypeList(AppHandle *appHandle);
272EXPORT char *appHandleGetAudioTypeFilePath(AppHandle *appHandle, const char *audioType, const char *posfix);
273EXPORT char *appHandleGetPreloadAudioTypeFilePath(AppHandle *appHandle, const char *audioType, const char *posfix);
274EXPORT APP_STATUS appHandleLoadAllAudioTypeHash(AppHandle *appHandle);
275EXPORT int appHandleWriteLock(AppHandle *appHandle, const char *callerFun);
276EXPORT int appHandleReadLock(AppHandle *appHandle, const char *callerFun);
277EXPORT int appHandleUnlock(AppHandle *appHandle);
278EXPORT int appHandleInstWriteLock(const char *callerFun);
279EXPORT int appHandleInstUnlock(void);
280EXPORT int appHandleIsNodeFeatureOptionEnabled(AppHandle *appHandle, xmlNode *node, int defaultValue);
281EXPORT void appHandleRemoveAudioTypeByFeatureOptions(AppHandle *appHandle);
282EXPORT void appHandleReviseXmlDocByFeatureOptions(AppHandle *appHandle);
283EXPORT APP_STATUS appHandleGetAudioTypeSupportedVerInfo(const char *audioTypeName, int *paramUnitDescVerMaj, int *paramUnitDescVerMin, int *audioParamVerMaj, int *audioParamVerMin);
284EXPORT void appHandleShowAudioTypeSupportedVerInfo(AppHandle *appHandle);
285EXPORT void appHandleReloadCustXml(AppHandle *appHandle);
286EXPORT void appHandleNotifyAllCallbacks(AppHandle *appHandle, const char *audioTypeName);
287EXPORT void *appHandleThreadLoop(void *arg);
288EXPORT void *reloadCustXmlThreadLoop(void *arg);
289
290/* AudioType API */
291EXPORT AudioType *audioTypeCreate(AppHandle *appHandle, const char *audioTypeName);
292EXPORT void audioTypeRelease(AudioType *audioType);
293EXPORT void audioTypeReleaseAudioParam(AudioType *audioType);
294EXPORT void audioTypeDump(AudioType *audioType);
295EXPORT APP_STATUS audioTypeParseTabName(AudioType *audioType);
296EXPORT APP_STATUS audioTypeLoadStage1Hash(AudioType *audioType);
297EXPORT APP_STATUS audioTypeLoadStage2Hash(AudioType *audioType);
298EXPORT APP_STATUS audioTypeLoadParamTreeHash(AudioType *audioType);
299EXPORT APP_STATUS audioTypeLoadParamTreeView(AudioType *audioType);
300EXPORT APP_STATUS audioTypeLoadParamUnitHash(AudioType *audioType);
301EXPORT Param *audioTypeGetParamHash(AudioType *audioType, xmlNode *paramUnitNode);
302EXPORT xmlNode *audioTypeGetParamUnitDescNode(AudioType *audioType);
303EXPORT xmlNode *audioTypeGetParamUnitNode(AudioType *audioType);
304EXPORT APP_STATUS audioTypeParseXmlVer(AudioType *audioType);
305EXPORT APP_STATUS audioTypeLoadParamFieldInfoHash(AudioType *audioType);
306EXPORT APP_STATUS audioTypeLoadCategoryTypeHash(AudioType *audioType);
307EXPORT size_t audioTypeGetNumOfParamTree(AudioType *audioType);
308EXPORT APP_STATUS audioTypeValidCategoryGroupName(AudioType *audioType, const char *name);
309EXPORT int audioTypeIsHardCategoryGroup(AudioType *audioType, const char *categoryName);
310EXPORT APP_STATUS audioTypeSetupAudioParamNode(AudioType *audioType, xmlNodePtr audioParamNode);
311
312/* CategoryType API */
313EXPORT CategoryType *categoryTypeCreate(const char *name, const char *wording, AudioType *audioType, int visible);
314EXPORT void categoryTypeRelease(CategoryType *categoryType);
315EXPORT size_t categoryTypeGetNumOfAllCategory(CategoryType *categoryType);
316EXPORT Category *categoryTypeGetAllCategoryByIndex(CategoryType *categoryType, size_t index);
317EXPORT CategoryAlias *categoryTypeGetCategoryByAlias(CategoryType *categoryType, const char *alias);
318EXPORT Category *categoryTypeGetCategoryByName(CategoryType *categoryType, const char *name);
319
320/* CategoryGroup API */
321EXPORT CategoryGroup *categoryGroupCreate(const char *categoryGroupName, const char *categoryGroupWording, CategoryType *categoryType, int visible);
322EXPORT void categoryGroupRelease(CategoryGroup *categoryGroup);
323
324/* Category API */
325EXPORT Category *categoryCreate(const char *name, const char *wording, CATEGORY_PARENT_TYPE parentTypeIsCategoryType, void *parent, int visible);
326EXPORT void categoryRelease(Category *category);
327
328/* ParamTree API */
329EXPORT ParamTree *paramTreeCreate(int paramId, const char *categoryPath);
330EXPORT void paramTreeRelease(ParamTree *paramTree);
331EXPORT size_t paramTreeGetNumOfParam(ParamTree *paramTree);
332
333/* ParamUnit API */
334EXPORT ParamUnit *paramUnitCreate(AudioType *audioType, int id, Param *param);
335EXPORT ParamUnit *paramUnitClone(ParamUnit *paramUnit);
336EXPORT void paramUnitRelease(ParamUnit *paramUnit);
337
338/* ParamInfo API */
339EXPORT ParamInfo *paramInfoCreate(const char *name, DATA_TYPE dataType, AudioType *audioType);
340EXPORT void paramInfoRelease(ParamInfo *paramInfo);
341
342/* FieldInfo API */
343EXPORT FieldInfo *fieldInfoCreate(const char *fieldName, unsigned int arrayIndex, int startBit, int endBit, const char *checkList, ParamInfo *paramInfo);
344EXPORT void fieldInfoRelease(FieldInfo *paramInfo);
345
346/* Param API */
347EXPORT Param *paramCreate(const char *paramName, ParamInfo *paramInfo, const char *paramValue);
348EXPORT void paramRelease(Param *param);
349EXPORT APP_STATUS paramSetupDataInfoByStr(Param *param, const char *str);
350EXPORT APP_STATUS paramSetupDataInfoByVal(Param *param, void *data, int arraySize);
351EXPORT Param *paramHashClone(Param *paramHash);
352
353/* ParamTreeView API */
354EXPORT ParamTreeView *paramTreeViewCreate(AudioType *audioType, int verMaj, int verMin);
355EXPORT void paramTreeViewRelease(ParamTreeView *paramTreeView);
356EXPORT TreeRoot *treeRootCreate(const char *name, xmlNode *treeRootNode, ParamTreeView *paramTreeView);
357EXPORT void treeRootRelease(TreeRoot *treeRoot);
358EXPORT Feature *featureCreate(const char *name, AudioType *audioType, FieldInfo *switchFieldInfo, const char *featureOption);
359EXPORT void featureRelease(Feature *feature);
360EXPORT CategoryPath *categoryPathCreate(Feature *feature, const char *path);
361EXPORT void categoryPathRelease(CategoryPath *categoryPath);
362EXPORT APP_STATUS categoryPathValidation(CategoryPath *categoryPath);
363EXPORT FeatureField *featureFieldCreate(FieldInfo *fieldInfo);
364EXPORT void featureFieldRelease(FeatureField *featureField);
365
366/* Feature Options API */
367EXPORT FeatureOption *featureOptionCreate(const char *name, const char *value);
368EXPORT void featureOptionRelease(FeatureOption *featureOption);
369
370/* Utils API */
371EXPORT char *utilConvDataToString(DATA_TYPE dataType, void *data, int arraySize, int uArrayHexMode);
372EXPORT UT_string *utilNormalizeCategoryPathForAudioType(const char *categoryPath, AudioType *audioType);
373EXPORT UT_string *utilNormalizeCategoryGroupPathForAudioType(const char *categoryPath, AudioType *audioType);
374EXPORT int utilFindUnusedParamId(AudioType *audioType);
375EXPORT void utilUsleep(unsigned int usec);
376EXPORT void utilLog(char *str, ...);
377EXPORT void utilLogClose(void);
378EXPORT FieldInfo *utilXmlNodeGetFieldInfo(AppHandle *appHandle, xmlNode *node, const char *audioTypeAttrName, const char *paramAttrName, const char *fieldAttrName);
379EXPORT void appDumpXmlDoc(xmlDoc *doc);
380EXPORT void redirectIOToConsole(void);
381EXPORT void utilMkdir(const char *dir);
382EXPORT void utilShowParamValue(Param *param);
383EXPORT char *utilStrtok(char *str, const char *delim, char **saveptr);
384EXPORT char *utilGenCheckList(int bits);
385EXPORT int utilCompNormalizeCategoryPath(AudioType *audioType, const char *srcCategoryPath, const char *dstCategoryPath);
386EXPORT int isCustXmlEnable(void);
387EXPORT void utilShellExecute(const char *prog, const char *params);
388EXPORT int utilIsAudioTypeInLoadingList(const char *audioType);
389EXPORT int utilIsUIAudioType(const char *audioType);
390EXPORT void utilDumpAudioTypeLoadingList(const char *audioTypeLoadingList[]);
391
392#if defined(SYS_IMPL)
393EXPORT APP_STATUS registerAudioParameterChangedCallback(AppHandle *appHandle);
394EXPORT APP_STATUS unregisterAudioParameterChangedCallback(AppHandle *appHandle);
395#endif
396
397#ifndef WIN32
398EXPORT void signalHandler(int sig, siginfo_t *info, void *ucontext);
399EXPORT char *audioSystemGetParameters(const char *str);
400EXPORT void audioSystemSetParameters(const char *str);
401#endif
402
403/* Unit Test */
404EXPORT void testDebugLevel(void);
405EXPORT void testHashParamTree(void);
406EXPORT void testHashParamUnit(void);
407EXPORT void testHashParam(void);
408EXPORT APP_STATUS testReadWriteParam(AppHandle *appHandle);
409EXPORT APP_STATUS testMemoryLeak(AppHandle *appHandle);
410EXPORT APP_STATUS testAudioTypeLock(AppHandle *appHandle);
411EXPORT APP_STATUS testAppHandleInitUninit(void);
412EXPORT void inotifyTest(const char *path);
413EXPORT void notifyCbTest(AppHandle *appHandle);
414
415#ifndef WIN32
416#ifdef __cplusplus
417}
418#endif
419#endif