LocationAccessQuery builder changes and tests
Add tests for the new requirements on LocationAccessQuery.Builder
Modify permission checks in PhoneInterfaceManager to adapt to the new
requirements.
Bug: 157170257
Test: atest LocationAccessPolicyTest
Merged-In: If6791955d360d019e175cc9255126fd956faae87
Change-Id: If6791955d360d019e175cc9255126fd956faae87
(cherry picked from commit c4a3e42c749b0d03a3928dc09cb9c36a03a87916)
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 68bc19c..a53fe55 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -5770,6 +5770,8 @@
.setCallingUid(Binder.getCallingUid())
.setMethod("getCellNetworkScanResults")
.setMinSdkVersionForFine(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForCoarse(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForEnforcement(Build.VERSION_CODES.Q)
.build());
switch (locationResult) {
case DENIED_HARD:
@@ -7449,6 +7451,8 @@
.setMethod("getServiceStateForSubscriber")
.setLogAsInfo(true)
.setMinSdkVersionForFine(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForCoarse(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForEnforcement(Build.VERSION_CODES.Q)
.build());
LocationAccessPolicy.LocationPermissionResult coarseLocationResult =
@@ -7461,6 +7465,8 @@
.setMethod("getServiceStateForSubscriber")
.setLogAsInfo(true)
.setMinSdkVersionForCoarse(Build.VERSION_CODES.Q)
+ .setMinSdkVersionForFine(Integer.MAX_VALUE)
+ .setMinSdkVersionForEnforcement(Build.VERSION_CODES.Q)
.build());
// We don't care about hard or soft here -- all we need to know is how much info to scrub.
boolean hasFinePermission =