How to expose variable from HAL to shared librarie

2019-08-15 12:18发布

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条回答
聊天终结者
2楼-- · 2019-08-15 12:43

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.

查看更多
登录 后发表回答