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

Commit ec2fcbdd authored by Evan Severson's avatar Evan Severson
Browse files

Add string to differentiate storage permission requests

Show a different request string for isolated storage

Test: Build and check dialog for various permissions
Fixes: 129945863
Change-Id: Ibc08e34b58005418aa613ffc6bb6a777729a1679
parent 08adc739
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -798,4 +798,8 @@ Allow <xliff:g id="app_name" example="Gmail">%4$s</xliff:g> to upload a bug repo

    <!-- Subtitle for switch that enables/disables the microphone status bar icon for the currently selected assistant. [CHAR LIMIT=none] -->
    <string name="assistant_record_audio_user_sensitive_summary">Show icon in status bar when microphone is used to activate voice assistant</string>

    <!-- Message shown to the user when the apps requests permission from this group. Shows in the isolated storage case. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
    <string name="permgrouprequest_storage_isolated">Allow
        &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access photos and media on your device?</string>
</resources>
+6 −1
Original line number Diff line number Diff line
@@ -552,7 +552,12 @@ public final class Utils {
     */
    public static CharSequence getRequestMessage(CharSequence appLabel, AppPermissionGroup group,
            Context context, @StringRes int requestRes) {
        if (requestRes != 0) {
        if (group.getName().equals(STORAGE) && !group.isNonIsolatedStorage()) {
            return Html.fromHtml(
                    String.format(context.getResources().getConfiguration().getLocales().get(0),
                            context.getString(R.string.permgrouprequest_storage_isolated),
                            appLabel), 0);
        } else if (requestRes != 0) {
            try {
                return Html.fromHtml(context.getPackageManager().getResourcesForApplication(
                        group.getDeclaringPackage()).getString(requestRes, appLabel), 0);