Refactor the VirtualSensor API.
Make the virtual sensor callback VirtualDevice-level instead of VirtualSensor-level. This allows for clients of the API to define a single callback that takes the sensor as an argument instead of defining callback per sensor. Also, this allows for mimicking the HAL APIs for direct channel support, as channel registration and unregistration are at HAL level and not at sensor level. This is a nicer solution because the VirtualDevice essentially acts as the sensor HAL. In more detail what this CL does: - Rename the VirtualSensorCallback and move it to its own file - Rename the callback method to onListenersChanged - Make VirtualSensor Parcelable so it can be passed to the callback - Move the VirtualSensor ownership to VirtualDeviceImpl - Make VirtualDevice id avaiable from VirtualSensor. - Return a boolean from the internal callbacks indicating success - Move the non-CTS VirtualDeviceParamsTest cases to the CTS one Bug: 266042170 Test: atest VirtualSensorConfigTest Test: atest SensorControllerTest Test: atest VirtualDeviceManagerServiceTest Change-Id: I14127f7a000d84ba41ade6ebda41c95a0c350fc9
Loading
Please register or sign in to comment