Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cca5818a authored by Devin Moore's avatar Devin Moore
Browse files

sensorservice: use new convert functions

Avoid the reinterpret_cast that has no guarentees.

Test: atest VtsHalSensorManagerTargetTest
Test: atest VtsHalSensorManagerV1_0TargetTest
Bug: 259711109

Change-Id: Icf64c8809f0575957fe17a607986288fce351972
parent 5aa06dad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ ndk::ScopedAStatus convertResult(status_t src) {
::aidl::android::hardware::sensors::Event convertEvent(const ::ASensorEvent& src) {
    ::aidl::android::hardware::sensors::Event dst;
    ::android::hardware::sensors::implementation::
            convertFromSensorEvent(reinterpret_cast<const sensors_event_t&>(src), &dst);
            convertFromASensorEvent(src, &dst);
    return dst;
}

+2 −2
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ Result convertResult(status_t status) {

::android::hardware::sensors::V1_0::Event convertEvent(const ::ASensorEvent& src) {
    ::android::hardware::sensors::V1_0::Event dst;
    ::android::hardware::sensors::V1_0::implementation::convertFromSensorEvent(
            reinterpret_cast<const sensors_event_t&>(src), &dst);
    ::android::hardware::sensors::V1_0::implementation::convertFromASensorEvent(
            src, &dst);
    return dst;
}