Add tests for AppOpsService foreground location
Test transition between different proc states and
verify that the location perm is granted in the
right states.
Bug: 130313658
Test: atest FrameworksServicesTests:AppOpsServiceTest
Change-Id: I8f9789e1699a776a30b2580a606266ec4b72b2d8
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 4c3bb8c..873cadb 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -220,7 +220,8 @@
* global Settings. Any access to this class or its fields should be done while
* holding the AppOpsService lock.
*/
- private final class Constants extends ContentObserver {
+ @VisibleForTesting
+ final class Constants extends ContentObserver {
// Key names stored in the settings value.
private static final String KEY_TOP_STATE_SETTLE_TIME = "top_state_settle_time";
private static final String KEY_FG_SERVICE_STATE_SETTLE_TIME
@@ -305,7 +306,8 @@
}
}
- private final Constants mConstants;
+ @VisibleForTesting
+ final Constants mConstants;
@VisibleForTesting
static final class UidState {