From db516d98c5ce826807a70ca02a7708922c18ef96 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Wed, 17 Apr 2019 11:10:48 -0700 Subject: [PATCH] Only get apps with permission granted. The subtitle gives the number of apps that can access location, but it currently collects all apps that request location, including those that are denied. Ensure that we only count granted apps. Bug: 129296799 Test: Open Settings, see the count is much lower. Change-Id: I9a18bbb62be742731205dab9f5b8e9a703ea030c --- .../location/TopLevelLocationPreferenceController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/location/TopLevelLocationPreferenceController.java b/src/com/android/settings/location/TopLevelLocationPreferenceController.java index 2a7a3d7de2d..baad7805b4d 100644 --- a/src/com/android/settings/location/TopLevelLocationPreferenceController.java +++ b/src/com/android/settings/location/TopLevelLocationPreferenceController.java @@ -71,7 +71,8 @@ public class TopLevelLocationPreferenceController extends BasePreferenceControll return; } mContext.getSystemService(PermissionControllerManager.class).countPermissionApps( - Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), 0, + Arrays.asList(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION), + PermissionControllerManager.COUNT_ONLY_WHEN_GRANTED, (numApps) -> { setLocationAppCount(numApps); }, null);