diff options
| author | 2018-11-12 10:43:55 -0800 | |
|---|---|---|
| committer | 2018-11-12 10:43:55 -0800 | |
| commit | d829b16b0bcd80df77ee5286f1974ae1867ed5a6 (patch) | |
| tree | 87dce2c8df881057cb304b3d4190176081218a5a | |
| parent | 69f39989c2a0f9bf94725bf0733d76e03b08d710 (diff) | |
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
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index a9819fc6973f..2be5dc966746 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -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; |