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

Commit 6d8c1c79 authored by Pontus Lidman's avatar Pontus Lidman Committed by Automerger Merge Worker
Browse files

Merge "Make maximum sensor fusion rate tunable." into main am: dc176d99 am:...

Merge "Make maximum sensor fusion rate tunable." into main am: dc176d99 am: 5dae10e5 am: 3c65fd64 am: 699d25a2 am: 8ebdb10a

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2668025



Change-Id: I1a90bbd7f39ae35a33e458a15e8e80fc46c0e8e7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a18e2885 8ebdb10a
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include "SensorService.h"
#include "SensorService.h"


#include <android/util/ProtoOutputStream.h>
#include <android/util/ProtoOutputStream.h>
#include <cutils/properties.h>
#include <frameworks/base/core/proto/android/service/sensor_service.proto.h>
#include <frameworks/base/core/proto/android/service/sensor_service.proto.h>


namespace android {
namespace android {
@@ -60,9 +61,11 @@ SensorFusion::SensorFusion()
            mGyro = uncalibratedGyro;
            mGyro = uncalibratedGyro;
        }
        }


        // 200 Hz for gyro events is a good compromise between precision
        // Wearable devices will want to tune this parameter
        // and power/cpu usage.
        // to 100 (Hz) in device.mk to save some power.
        mEstimatedGyroRate = 200;
        int32_t value = property_get_int32(
            "sensors.aosp_low_power_sensor_fusion.maximum_rate", 200);
        mEstimatedGyroRate = static_cast<float>(value);
        mTargetDelayNs = 1000000000LL / mEstimatedGyroRate;
        mTargetDelayNs = 1000000000LL / mEstimatedGyroRate;


        for (int i = 0; i<NUM_FUSION_MODE; ++i) {
        for (int i = 0; i<NUM_FUSION_MODE; ++i) {