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

Commit d829b16b authored by Joel Galenson's avatar Joel Galenson
Browse files

Fix off-by-one error in historical app ops.

Both the comment and the usage suggest that this index should be
exclusive, not inclusive.

Bug: 111061782
Test: Call getBackgroundAccessCount without crashing
Change-Id: Ie4eb5a59874afd27bed0706cd177757155351b49
parent 69f39989
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2323,7 +2323,7 @@ public class AppOpsManager {
         */
        private static long sum(@NonNull long[] counts, int start, int end) {
            long totalCount = 0;
            for (int i = start; i <= end; i++) {
            for (int i = start; i < end; i++) {
                totalCount += counts[i];
            }
            return totalCount;