diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-06-09 06:43:43 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-09 06:43:43 +0000 |
commit | 1e61ec61fbb6900d2a79c13e4c4967baa5bc86fe (patch) | |
tree | 93bde68db4ac83ad640ce3f211bd766627957063 | |
parent | 6c4fe66b8d2d1fd0569c9215f59f8fe0ff3bd48d (diff) | |
parent | 52bac0ab8598e7429a6de6a5bad8c2222a6708ae (diff) |
Merge "Ensure beginTimeMillis is non-negative." into rvc-dev am: f2193638d7 am: 52bac0ab85
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11799714
Change-Id: I4d41fb84f0970ea622b4c9457fd3b3db82558bdc
-rw-r--r-- | services/core/java/com/android/server/appop/AppOpsService.java | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/stats/pull/StatsPullAtomService.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index c47b66b2ac51..435e82535baf 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -6035,7 +6035,7 @@ public class AppOpsService extends IAppOpsService.Stub { List<String> runtimeAppOpsList = getRuntimeAppOpsList(); AppOpsManager.HistoricalOpsRequest histOpsRequest = new AppOpsManager.HistoricalOpsRequest.Builder( - Instant.now().minus(7, ChronoUnit.DAYS).toEpochMilli(), + Math.max(Instant.now().minus(7, ChronoUnit.DAYS).toEpochMilli(), 0), Long.MAX_VALUE).setOpNames(runtimeAppOpsList).setFlags( OP_FLAG_SELF | OP_FLAG_TRUSTED_PROXIED).build(); appOps.getHistoricalOps(histOpsRequest, AsyncTask.THREAD_POOL_EXECUTOR, diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java index cc4505c26aed..c2bae1a8962b 100644 --- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java +++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java @@ -3519,7 +3519,7 @@ public class StatsPullAtomService extends SystemService { CompletableFuture<HistoricalOps> ops = new CompletableFuture<>(); HistoricalOpsRequest histOpsRequest = new HistoricalOpsRequest.Builder( - Instant.now().minus(1, ChronoUnit.DAYS).toEpochMilli(), + Math.max(Instant.now().minus(1, ChronoUnit.DAYS).toEpochMilli(), 0), Long.MAX_VALUE).setFlags( OP_FLAGS_PULLED).build(); appOps.getHistoricalOps(histOpsRequest, AsyncTask.THREAD_POOL_EXECUTOR, ops::complete); |