Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22ab71c7 authored by Joel Galenson's avatar Joel Galenson Committed by tmfang
Browse files

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
parent 41562c66
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -10916,17 +10916,15 @@
    <string name="permission_bar_chart_empty_text">0 apps used permissions</string>
    <!-- Text for permission bar chart title in Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="permission_bar_chart_title">Most-used permissions in last 24 hours</string>
    <!-- Text for permission bar chart title in Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="permission_bar_chart_title_v2">In last 24 hr, apps on this device accessed</string>
    <string name="permission_bar_chart_title">Permission usage in last 24 hours</string>
    <!-- Text for permission bar chart details in Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="permission_bar_chart_details">View Permissions Dashboard</string>
    <string name="permission_bar_chart_details">See all in Dashboard</string>
    <!-- Text for permission bar chart details in Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="permission_bar_chart_details_v2">See all permission usage in Dashboard</string>
    <!-- Text for permission bar chart details in Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="permission_bar_chart_details_v3">+ <xliff:g id="permissionCount" example="3">%1$d</xliff:g> other permissions</string>
    <plurals name="permission_bar_chart_label">
        <item quantity="one">1 app</item>
        <item quantity="other"><xliff:g id="number" example="7">%s</xliff:g> apps</item>
    </plurals>
    <!-- Title for the accessibility usage preference in the Privacy page.  [CHAR LIMIT=NONE] -->
    <string name="accessibility_usage_title">Accessibility usage</string>
+5 −4
Original line number Diff line number Diff line
@@ -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.