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

Commit 41e3e2ee authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Android (Google) Code Review
Browse files

Merge "Logging sensor event timestamp when changing state" into main

parents 3b772360 95c0236c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.hardware.SensorManager.SENSOR_DELAY_FASTEST;
import static android.hardware.devicestate.DeviceState.PROPERTY_POLICY_UNSUPPORTED_WHEN_POWER_SAVE_MODE;
import static android.hardware.devicestate.DeviceState.PROPERTY_POLICY_UNSUPPORTED_WHEN_THERMAL_STATUS_CRITICAL;
import static android.hardware.devicestate.DeviceStateManager.INVALID_DEVICE_STATE_IDENTIFIER;
import static android.os.Trace.TRACE_TAG_SYSTEM_SERVER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.TYPE_EXTERNAL;

@@ -324,6 +325,11 @@ public final class FoldableDeviceStateProvider implements DeviceStateProvider,
            }

            if (newState != INVALID_DEVICE_STATE_IDENTIFIER && newState != mLastReportedState) {
                if (Trace.isTagEnabled(TRACE_TAG_SYSTEM_SERVER)) {
                    Trace.instant(TRACE_TAG_SYSTEM_SERVER,
                            "[Device state changed] Last hinge sensor event timestamp: "
                                    + mLastHingeAngleSensorEvent.timestamp);
                }
                mLastReportedState = newState;
                stateToReport = newState;
            }