How to expose variable from HAL to shared libraries present in system/lib/hw (android)?

家住魔仙堡 提交于 2019-12-13 19:12:22

问题


I made some changes in the platform specific existing HAL, and I want this changes to be get selected when I start my audio stream.

For this I need to differentiate it from other streams, so I added a variable in HAL and I wanted it to be exposed to my shared library that I will be pushing to system/lib/hw directory, so that when I start my stream I set this variable in my .so

So that in HAL I can differentiate it from other streams.

Any ideas to expose the variable in HAL to shared library in system/lib/hw ?

Suggestions/help will be really appreciated.


回答1:


I would suggest that you add a new stream type (AUDIO_STREAM_), and possibly a new routing strategy (STRATEGY_). Then modify getStrategy in the AudioPolicyManager to return your new strategy when your new stream type is used, and modify getDeviceForStrategy to select the appropriate DEVICE_OUT_ value for your new routing strategy.



来源:https://stackoverflow.com/questions/31705819/how-to-expose-variable-from-hal-to-shared-libraries-present-in-system-lib-hw-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!