Add Sensors Multihal support for Hal 2.0
The multihal framework is a HAL interface for the sensors framework that allows multiple vendors to package their HAL implementation into a subHAL dynamic library that will be loaded and used to pass on method calls to the appropriate subHAL. The HalProxy object, that will act as the main proxy sensors wrapper for the multiHAL handles writing sensor events to the event FMQ and wakelock acquisition and releasing via a callback object it passes to the subHALs. In order to turn your HAL 2.0 executable into a subHAL to be used by the multiHAL, implement the Return<Result> initialize(sp<HalProxyCallback>& callback) method of the ISensorsSubHal derived class. Implement the ISensorsSubHal* sensorsHalGetSubHal(uint32_t* version)method and have it return a pointer to your subHAL object. Build this into a dynamic library and list its filename under /vendor/etc/sensors/hals.conf. Squashed commits: 07b442e9 (refs/published/mh2_2) MH2 | Write processedEvents instead of original events. b38f2e25 Merge "MH2 | Check that subhal index is in range" d38f9947 Merge "MH2 | Implement debug method of HalProxy" bf46132f (refs/published/mh2_4, mh2_4) MH2 | Implement debug method of HalProxy 1de5bb33 MH2 | Fix wakelock name e0721534 (refs/published/mh2_3, mh2_3) MH2 | Check that subhal index is in range 336c1c71 MH2 | Add restart logic in HalProxy::initialize method. 731d7125 MH2 | Change rc file to more appropriate settings f09465d1 MH2 | Add makeFMQ helpers to HalProxy_test 75cc7bf2 MH2 | Implement wakelock processing thread e93fdf9a MH2 | Implement dynamic sensors callbacks on HalProxy 82b84148 Remove libhwbinder/libhidltransport deps d45e49b4 Merge "MH2 | Implement pending writes thread" 59714269 MH2 | Implement pending writes thread db23aa82 MH2 | Implement direct channel and direct report methods 83e4370a MH2 | Implement injectSensorData method of HalProxy d0cd57d4 MH2 | Implement ScopeWakelock ctor and dtor 537c0274 MH2 | Add rough proxy callback postEvents method f97a3f35 Multihal 2.0 - Small tweaks to sensorHandle handling 7a723546 MultiHal 2.0 - setOperationMode and init direct channel flags dc7a8e78 MultiHal 2.0 - Get sensors list from subhals 4b4c7b74 MultiHal 2.0 - activate, batch, flush methods of HalProxy 1638531d MultiHal 2.0 - proxying api calls helper methods aacbf948 Set up shell to use for unit tests 2879067d Multihal 2.0 - Implement SubHal discovery c34e6683 Add a sub-HAL implementation for testing multi-HAL a689f8a6 Add skeleton for multihal 2.0 Bug: 136511617 Test: atest android.hardware.sensors@2.0-halproxy-unit-tests && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalSensorsV2_0Target Change-Id: Ibe92d40c92b70848526b0e941bbcffbaf81ffaf2
Loading
Please register or sign in to comment