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

Commit 2d2a380c authored by Arne Coucheron's avatar Arne Coucheron Committed by Gerrit Code Review
Browse files

sensors: Rename bool for selecting what timestamp to use for orientation sensor

RM-208
Change-Id: I4e91c48ad1520a8a88a92e18ab7e71edaf313ba2
parent 700031ae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2528,7 +2528,7 @@
    <!-- Show battery fully charged notification -->
    <bool name="config_showBatteryFullyChargedNotification">false</bool>

    <!-- Older sensors are not setting event.timestamp correctly. Setting to
    <!-- Older rotation sensors are not setting event.timestamp correctly. Setting to
         true will use SystemClock.elapsedRealtimeNanos() to set timestamp. -->
    <bool name="config_useSystemClockforSensors">false</bool>
    <bool name="config_useSystemClockforRotationSensor">false</bool>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -2409,5 +2409,5 @@

  <java-symbol type="string" name="config_packagedKeyboardName" />

  <java-symbol type="bool" name="config_useSystemClockforSensors" />
  <java-symbol type="bool" name="config_useSystemClockforRotationSensor" />
</resources>
+4 −4
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public abstract class WindowOrientationListener {
    private boolean mEnabled;
    private int mRate;
    private String mSensorType;
    private boolean mUseSystemClockforSensors;
    private boolean mUseSystemClockforRotationSensor;
    private Sensor mSensor;
    private OrientationJudge mOrientationJudge;
    private int mCurrentRotation = -1;
@@ -91,8 +91,8 @@ public abstract class WindowOrientationListener {

        mSensorType = context.getResources().getString(
                com.android.internal.R.string.config_orientationSensorType);
        mUseSystemClockforSensors = context.getResources().getBoolean(
                com.android.internal.R.bool.config_useSystemClockforSensors);
        mUseSystemClockforRotationSensor = context.getResources().getBoolean(
                com.android.internal.R.bool.config_useSystemClockforRotationSensor);

        if (!TextUtils.isEmpty(mSensorType)) {
            List<Sensor> sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
@@ -602,7 +602,7 @@ public abstract class WindowOrientationListener {
                // Reset the orientation listener state if the samples are too far apart in time
                // or when we see values of (0, 0, 0) which indicates that we polled the
                // accelerometer too soon after turning it on and we don't have any data yet.
                final long now = mUseSystemClockforSensors
                final long now = mUseSystemClockforRotationSensor
                        ? SystemClock.elapsedRealtimeNanos() : event.timestamp;
                final long then = mLastFilteredTimestampNanos;
                final float timeDeltaMS = (now - then) * 0.000001f;