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

Commit 5104a0f2 authored by Stanislav Zholnin's avatar Stanislav Zholnin
Browse files

Make timestamps used in AppOpsService consistent.

Bug:144997947
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 10060 - no negative duration observed
Change-Id: Ie65f2eec606b886921017061daf97679476cd84d
parent 2e7cb389
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1115,6 +1115,7 @@ public class AppOpsService extends IAppOpsService.Stub {
                    // There is some actively running operation...  need to find it
                    // and appropriately update its state.
                    final long now = System.currentTimeMillis();
                    final long nowElapsed = SystemClock.elapsedRealtime();
                    for (int i = uidState.pkgOps.size() - 1; i >= 0; i--) {
                        final Ops ops = uidState.pkgOps.valueAt(i);
                        for (int j = ops.size() - 1; j >= 0; j--) {
@@ -1136,7 +1137,7 @@ public class AppOpsService extends IAppOpsService.Stub {
                                    featureOp.finished(now, duration, oldPendingState,
                                            AppOpsManager.OP_FLAG_SELF);
                                    // Start the op in the new state
                                    featureOp.startRealtime = now;
                                    featureOp.startRealtime = nowElapsed;
                                    featureOp.started(now, newState, AppOpsManager.OP_FLAG_SELF);
                                }
                            }