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

Commit 43b41aaf authored by Joel Galenson's avatar Joel Galenson
Browse files

Update to a newer version of the Permission Hub mocks.

This gives singleton/uncoalesced entries "parent" permissions just
like the coalesced ones to be more consistent.  It also changes the
summary, title, and icon of the entries themselves, including changing
to absolute time for entries in the current day and the date for older
entries.

It also changes the default sort to recency, adds a one minute filter,
and continues to remove the Storage permission.

Bug: 63532550
Test: Open Permissions Hub
Change-Id: Ib37a93d0bc47eaa6a74d5df192e833cfb13949e1
parent 4f908641
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -38,6 +38,19 @@
        android:paddingBottom="16dp"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <LinearLayout
                android:id="@+id/title_widget_frame"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="start|center_vertical"
                android:paddingEnd="16dp"
                android:orientation="horizontal"/>

            <TextView
                android:id="@android:id/title"
                android:layout_width="wrap_content"
@@ -46,6 +59,8 @@
                android:textAppearance="@style/Preference_TextAppearanceMaterialSubhead"
                android:ellipsize="marquee"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@

        <com.android.packageinstaller.permission.ui.PreferenceImageView
            android:id="@+id/icon"
            android:layout_width="@dimen/preference_usage_summary_icon_size"
            android:layout_height="@dimen/preference_usage_summary_icon_size"
            android:layout_width="@dimen/preference_usage_title_summary_icon_size"
            android:layout_height="@dimen/preference_usage_title_summary_icon_size"
            android:layout_marginEnd="4dp"
            android:tint="?android:attr/colorControlNormal"/>

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
    <dimen name="app_permission_divider_margin_top">12dp</dimen>
    <dimen name="app_permission_divider_margin_bottom">8dp</dimen>

    <dimen name="preference_usage_summary_icon_size">16dp</dimen>
    <dimen name="preference_usage_title_summary_icon_size">16dp</dimen>

    <dimen name="grant_permissions_dialog_button_height">56dp</dimen>
</resources>
+11 −5
Original line number Diff line number Diff line
@@ -255,14 +255,11 @@
    <!-- Title for permission usage [CHAR LIMIT=30] -->
    <string name="permission_usage_title">Permissions usage</string>

    <!-- Summary for showing a single permission access and the time of the last access [CHAR LIMIT=80] -->
    <string name="permission_usage_summary_last_access"><xliff:g id="perm" example="Location">%1$s</xliff:g> - Last access <xliff:g id="time" example="2 hours">%2$s</xliff:g> ago</string>

    <!-- Summary for showing a single permission access and the number of accesses [CHAR LIMIT=80] -->
    <string name="permission_usage_summary_num_accesses"><xliff:g id="perm" example="Location">%1$s</xliff:g> - <xliff:g id="num" example="42">%2$s</xliff:g> accesses</string>
    <string name="permission_usage_summary">Last access: <xliff:g id="time" example="12:10 PM">%1$s</xliff:g>\n<xliff:g id="num" example="42">%2$s</xliff:g> accesses</string>

    <!-- Summary for showing a single permission access and the number of accesses, including those in the background [CHAR LIMIT=80] -->
    <string name="permission_usage_summary_num_accesses_background"><xliff:g id="perm" example="Location">%1$s</xliff:g> - <xliff:g id="num" example="42">%2$s</xliff:g> accesses (<xliff:g id="num" example="7">%3$s</xliff:g> in background)</string>
    <string name="permission_usage_summary_background">Last access: <xliff:g id="time" example="12:10 PM">%1$s</xliff:g>\n<xliff:g id="num" example="42">%2$s</xliff:g> accesses (<xliff:g id="num" example="7">%3$s</xliff:g> in background)</string>

    <!-- Description for showing permission accesses with any permission [CHAR LIMIT=30] -->
    <string name="permission_usage_any_permission">Any permission</string>
@@ -282,6 +279,9 @@
    <!-- Description for showing permissions accessed in the last 15 minutes [CHAR LIMIT=30] -->
    <string name="permission_usage_last_15_minutes">Last 15 minutes</string>

    <!-- Description for showing permissions accessed in the last minute [CHAR LIMIT=30] -->
    <string name="permission_usage_last_minute">Last 1 minute</string>

    <!-- Label when no apps have used the requested permissions [CHAR LIMIT=30] -->
    <string name="no_permission_usages">No permission usages</string>

@@ -300,6 +300,9 @@
    <!-- Label for the title of the list of permission usages that shows which apps used which permissions[CHAR LIMIT=50] -->
    <string name="permission_usage_list_title_last_15_minutes">Access in last 15 minutes</string>

    <!-- Label for the title of the list of permission usages that shows which apps used which permissions[CHAR LIMIT=50] -->
    <string name="permission_usage_list_title_last_minute">Access in last 1 minute</string>

    <!-- Label for the title of the permission bar chart showing how often the most common permissions are used [CHAR LIMIT=50] -->
    <string name="permission_usage_bar_chart_title_any_time">Top permission usage at any time</string>

@@ -315,6 +318,9 @@
    <!-- Label for the title of the permission bar chart showing how often the most common permissions are used [CHAR LIMIT=50] -->
    <string name="permission_usage_bar_chart_title_last_15_minutes">Top permission usage in last 15 minutes</string>

    <!-- Label for the title of the permission bar chart showing how often the most common permissions are used [CHAR LIMIT=50] -->
    <string name="permission_usage_bar_chart_title_last_minute">Top permission usage in last 1 minute</string>

    <!-- Label for the bars on the chart that shows how many apps have used various permissions [CHAR LIMIT=10] -->
    <string name="app_permission_usage_bar_label">Apps</string>

+5 −5
Original line number Diff line number Diff line
@@ -87,21 +87,21 @@ public class ExpandablePreferenceGroup extends PreferenceGroup {
        holder.setDividerAllowedAbove(false);
        holder.setDividerAllowedBelow(false);

        holder.findViewById(R.id.title_widget_frame).setVisibility(View.GONE);

        ViewGroup summaryFrame = (ViewGroup) holder.findViewById(R.id.summary_widget_frame);
        if (mSummaryIcons.isEmpty()) {
            summaryFrame.setVisibility(View.GONE);
        } else {
            summaryFrame.removeAllViews();
            int summaryIconSize = mContext.getResources().getDimensionPixelSize(
                    R.dimen.preference_usage_summary_icon_size);
            int numIcons = mSummaryIcons.size();
            for (int i = 0; i < numIcons; i++) {
                LayoutInflater inflater = mContext.getSystemService(LayoutInflater.class);
                ViewGroup layoutView = (ViewGroup) inflater.inflate(R.layout.summary_image_view,
                ViewGroup group = (ViewGroup) inflater.inflate(R.layout.title_summary_image_view,
                        null);
                ImageView imageView = layoutView.requireViewById(R.id.icon);
                ImageView imageView = group.requireViewById(R.id.icon);
                imageView.setImageResource(mSummaryIcons.get(i));
                summaryFrame.addView(layoutView);
                summaryFrame.addView(group);
            }
        }
    }
Loading