[DO NOT MERGE] Handle config override via settings correctly
Initialize persistence only after we can read the settings
provider as we need to take into account the current config
potentially set as an override in settings vs using the
hard coded defaults.
Make the last persist time more robust to ensure it always
termines to guard against other unforeseen cases wehere the
persistet files don't match what is expected under the current
config.
Test: atest CtsAppOpsTestCases
Test: atest android.appsecurity.cts.AppOpsTest
Bug: 134093967
Change-Id: I4bd272d3908eb8fc2afcdb7c1bd96b05a182d8c4
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 0a76845..7569363 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -201,7 +201,7 @@
@VisibleForTesting
final SparseArray<UidState> mUidStates = new SparseArray<>();
- private final HistoricalRegistry mHistoricalRegistry = new HistoricalRegistry(this);
+ final HistoricalRegistry mHistoricalRegistry = new HistoricalRegistry(this);
long mLastRealtime;