Loading sensors/2.0/default/SensorsV2_0.h +13 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,19 @@ namespace V2_0 { namespace implementation { struct SensorsV2_0 : public ::android::hardware::sensors::V2_X::implementation::Sensors<ISensors> { Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto &sensor : mSensors) { sensors.push_back(V2_1::implementation::convertToOldSensorInfo( sensor.second->getSensorInfo())); } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } }; } // namespace implementation Loading sensors/2.1/default/SensorsV2_1.h +18 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,23 @@ struct SensorsV2_1 : public Sensors { // Methods from ::android::hardware::sensors::V2_1::ISensors follow. Return<void> getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) override; Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto &sensor : mSensors) { auto &info = sensor.second->getSensorInfo(); if (info.type != SensorType::HINGE_ANGLE) { sensors.push_back(V2_1::implementation::convertToOldSensorInfo( sensor.second->getSensorInfo())); } } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } Return<Result> initialize_2_1( const ::android::hardware::MQDescriptorSync<V2_1::Event>& eventQueueDescriptor, const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor, Loading sensors/common/default/2.X/Sensors.h +0 −13 Original line number Diff line number Diff line Loading @@ -79,19 +79,6 @@ struct Sensors : public ISensorsInterface, public ISensorsEventCallback { } // Methods from ::android::hardware::sensors::V2_0::ISensors follow. Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto& sensor : mSensors) { sensors.push_back( V2_1::implementation::convertToOldSensorInfo(sensor.second->getSensorInfo())); } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } Return<Result> setOperationMode(OperationMode mode) override { for (auto sensor : mSensors) { sensor.second->setOperationMode(mode); Loading sensors/common/default/2.X/multihal/HalProxy.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -124,8 +124,10 @@ Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _h Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) { std::vector<V1_0::SensorInfo> sensors; for (const auto& iter : mSensors) { if (iter.second.type != SensorType::HINGE_ANGLE) { sensors.push_back(convertToOldSensorInfo(iter.second)); } } _hidl_cb(sensors); return Void(); } Loading sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ int32_t SensorsHidlTest::getInvalidSensorHandle() { for (const SensorInfoType& sensor : getSensorsList()) { maxHandle = std::max(maxHandle, sensor.sensorHandle); } return maxHandle + 1; return maxHandle + 42; } // Test if sensor list returned is valid Loading Loading
sensors/2.0/default/SensorsV2_0.h +13 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,19 @@ namespace V2_0 { namespace implementation { struct SensorsV2_0 : public ::android::hardware::sensors::V2_X::implementation::Sensors<ISensors> { Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto &sensor : mSensors) { sensors.push_back(V2_1::implementation::convertToOldSensorInfo( sensor.second->getSensorInfo())); } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } }; } // namespace implementation Loading
sensors/2.1/default/SensorsV2_1.h +18 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,23 @@ struct SensorsV2_1 : public Sensors { // Methods from ::android::hardware::sensors::V2_1::ISensors follow. Return<void> getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) override; Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto &sensor : mSensors) { auto &info = sensor.second->getSensorInfo(); if (info.type != SensorType::HINGE_ANGLE) { sensors.push_back(V2_1::implementation::convertToOldSensorInfo( sensor.second->getSensorInfo())); } } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } Return<Result> initialize_2_1( const ::android::hardware::MQDescriptorSync<V2_1::Event>& eventQueueDescriptor, const ::android::hardware::MQDescriptorSync<uint32_t>& wakeLockDescriptor, Loading
sensors/common/default/2.X/Sensors.h +0 −13 Original line number Diff line number Diff line Loading @@ -79,19 +79,6 @@ struct Sensors : public ISensorsInterface, public ISensorsEventCallback { } // Methods from ::android::hardware::sensors::V2_0::ISensors follow. Return<void> getSensorsList(V2_0::ISensors::getSensorsList_cb _hidl_cb) override { std::vector<V1_0::SensorInfo> sensors; for (const auto& sensor : mSensors) { sensors.push_back( V2_1::implementation::convertToOldSensorInfo(sensor.second->getSensorInfo())); } // Call the HIDL callback with the SensorInfo _hidl_cb(sensors); return Void(); } Return<Result> setOperationMode(OperationMode mode) override { for (auto sensor : mSensors) { sensor.second->setOperationMode(mode); Loading
sensors/common/default/2.X/multihal/HalProxy.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -124,8 +124,10 @@ Return<void> HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _h Return<void> HalProxy::getSensorsList(ISensorsV2_0::getSensorsList_cb _hidl_cb) { std::vector<V1_0::SensorInfo> sensors; for (const auto& iter : mSensors) { if (iter.second.type != SensorType::HINGE_ANGLE) { sensors.push_back(convertToOldSensorInfo(iter.second)); } } _hidl_cb(sensors); return Void(); } Loading
sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h +1 −1 Original line number Diff line number Diff line Loading @@ -366,7 +366,7 @@ int32_t SensorsHidlTest::getInvalidSensorHandle() { for (const SensorInfoType& sensor : getSensorsList()) { maxHandle = std::max(maxHandle, sensor.sensorHandle); } return maxHandle + 1; return maxHandle + 42; } // Test if sensor list returned is valid Loading