From 22ab71c7c6382e9563e9d3ba5883034d9ca1cbd2 Mon Sep 17 00:00:00 2001 From: Joel Galenson Date: Thu, 21 Mar 2019 10:00:20 -0700 Subject: [PATCH] Change the permission bar chart to use the new design - Each bar is now labeled with the permission name and the subtitle is slightly different. - Change some string for new design Test: View screen. Test: atest PermissionBarChartPreferenceControllerTest Change-Id: Ia82f9cbb6255d93c38a27b038ae5af3f066eec28 --- res/values/strings.xml | 14 ++++++-------- .../PermissionBarChartPreferenceController.java | 9 +++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9b23ca9a1b1..2137312f283 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10916,17 +10916,15 @@ 0 apps used permissions - Most-used permissions in last 24 hours - - In last 24 hr, apps on this device accessed + Permission usage in last 24 hours - View Permissions Dashboard + See all in Dashboard - - See all permission usage in Dashboard - - + %1$d other permissions + + 1 app + %s apps + Accessibility usage diff --git a/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java b/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java index 7c55b516dbf..b47ad9cc224 100644 --- a/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java +++ b/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java @@ -163,12 +163,13 @@ public class PermissionBarChartPreferenceController extends BasePreferenceContro for (int index = 0; index < barViewInfos.length; index++) { final RuntimePermissionUsageInfo permissionGroupInfo = usageInfos.get(index); + final int count = permissionGroupInfo.getAppAccessCount(); + final CharSequence permLabel = getPermissionGroupLabel(permissionGroupInfo.getName()); barViewInfos[index] = new BarViewInfo( - getPermissionGroupIcon(permissionGroupInfo.getName()), - permissionGroupInfo.getAppAccessCount(), - R.string.storage_detail_apps, - getPermissionGroupLabel(permissionGroupInfo.getName())); + getPermissionGroupIcon(permissionGroupInfo.getName()), count, permLabel, + mContext.getResources().getQuantityString(R.plurals.permission_bar_chart_label, + count, count), permLabel); // Set the click listener for each bar view. // The listener will navigate user to permission usage app.