Flags instead of booleans for countPermissionApps

Test: Checked that the api retunred the results
Bug: 123697839
Change-Id: Iadb1c4307933635e6114d3d32a2a2b1ed87949f4
This commit is contained in:
Philip P. Moltmann
2019-01-31 14:22:24 -08:00
parent 8e268830f2
commit a9fb152309
2 changed files with 4 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ public class AppLocationPermissionPreferenceController extends
PermissionControllerManager permController = PermissionControllerManager permController =
mContext.getSystemService(PermissionControllerManager.class); mContext.getSystemService(PermissionControllerManager.class);
permController.countPermissionApps( permController.countPermissionApps(
Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), false, false, Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), 0,
(numApps) -> { (numApps) -> {
mNumTotal = numApps; mNumTotal = numApps;
if (loadingInProgress.decrementAndGet() == 0) { if (loadingInProgress.decrementAndGet() == 0) {
@@ -85,7 +85,8 @@ public class AppLocationPermissionPreferenceController extends
}, null); }, null);
permController.countPermissionApps( permController.countPermissionApps(
Collections.singletonList(ACCESS_BACKGROUND_LOCATION), true, false, Collections.singletonList(ACCESS_BACKGROUND_LOCATION),
PermissionControllerManager.COUNT_ONLY_WHEN_GRANTED,
(numApps) -> { (numApps) -> {
mNumBackground = numApps; mNumBackground = numApps;
if (loadingInProgress.decrementAndGet() == 0) { if (loadingInProgress.decrementAndGet() == 0) {

View File

@@ -71,7 +71,7 @@ public class TopLevelLocationPreferenceController extends BasePreferenceControll
return; return;
} }
mContext.getSystemService(PermissionControllerManager.class).countPermissionApps( mContext.getSystemService(PermissionControllerManager.class).countPermissionApps(
Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), false, false, Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), 0,
(numApps) -> { (numApps) -> {
setLocationAppCount(numApps); setLocationAppCount(numApps);
}, null); }, null);