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

Commit 0fe1ce87 authored by Garfield Tan's avatar Garfield Tan
Browse files

Guard potential bad clocks from moving backward

CLOCK_MONOTONIC isn't always monotonic in a guest VM with crosvm as its
hypervisor. That may lead to AppOpsService crashes.

Bug: 320389375
Test: Presubmit tests.
Change-Id: If064c3f186e67cca3f5dc2ee96d9bde2233264c7
parent de8b5d9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -649,7 +649,7 @@ final class AttributedOp {

                accessEvents.append(makeKey(event.getUidState(), event.getFlags()),
                        new AppOpsManager.NoteOpEvent(event.getStartTime(),
                                now - event.getStartElapsedTime(),
                                Math.max(now - event.getStartElapsedTime(), 0),
                                event.getProxy()));
            }
        }