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

Unverified Commit 8d710d10 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-14.0.0_r22' into staging/lineage-21.0_android-security-14.0.0_r22

Android Security 14.0.0 Release 22 (13793696)

* tag 'android-security-14.0.0_r22':
  Trim the application name to make it safe for presentation

Change-Id: I11a7ea0d909491a60eda71a3983fab2cbf69ef18
parents 2de5344d cf72487d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -551,7 +551,7 @@
    <!-- Confrim dialog title show on open document tree flow. [CHAR_LIMIT=80] -->
    <string name="open_tree_dialog_title">Allow <xliff:g id="appName" example="Drive">%1$s</xliff:g> to access files in <xliff:g id="directory" example="DCIM">%2$s</xliff:g>?</string>
    <!-- Confrim dialog message show on open document tree flow.-->
    <string name="open_tree_dialog_message">This will let <xliff:g id="appName" example="Drive">%1$s</xliff:g> access current and future content stored in <xliff:g id="directory" example="DCIM">%2$s</xliff:g>.</string>
    <string name="open_tree_dialog_message">This will let "<xliff:g id="appName" example="Drive">%1$s</xliff:g>" access current and future content stored in <xliff:g id="directory" example="DCIM">%2$s</xliff:g>.</string>
    <!-- Header message title show on open document tree flow when directory is blocked. [CHAR_LIMIT=48] -->
    <string name="directory_blocked_header_title">Can\u2019t use this folder</string>
    <!-- Header message subtitle show on open document tree flow when directory is blocked. [CHAR_LIMIT=90]-->
+10 −2
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.documentsui.base;

import static android.text.TextUtils.SAFE_STRING_FLAG_SINGLE_LINE;
import static android.text.TextUtils.SAFE_STRING_FLAG_TRIM;

import static com.android.documentsui.base.SharedMinimal.TAG;

import android.app.Activity;
@@ -276,7 +279,7 @@ public final class Shared {
     * @return the calling app name or general anonymous name if not found
     */
    @NonNull
    public static String getCallingAppName(Activity activity) {
    public static CharSequence getCallingAppName(Activity activity) {
        final String anonymous = activity.getString(R.string.anonymous_application);
        final String packageName = getCallingPackageName(activity);
        if (TextUtils.isEmpty(packageName)) {
@@ -292,7 +295,12 @@ public final class Shared {
        }

        CharSequence result = pm.getApplicationLabel(ai);
        return TextUtils.isEmpty(result) ? anonymous : result.toString();
        if (TextUtils.isEmpty(result)) {
            return anonymous;
        }

        return TextUtils.makeSafeForPresentation(
                result.toString(), 500, 0, SAFE_STRING_FLAG_TRIM | SAFE_STRING_FLAG_SINGLE_LINE);
    }

    /**
+0 −5
Original line number Diff line number Diff line
@@ -1560,10 +1560,5 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
        public ActionHandler getActionHandler() {
            return mActions;
        }

        @Override
        public String getCallingAppName() {
            return Shared.getCallingAppName(mActivity);
        }
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ public abstract class DocumentsAdapter extends RecyclerView.Adapter<DocumentHold
        boolean isInSearchMode();
        boolean isSelected(String id);
        Model getModel();
        String getCallingAppName();
        boolean isDocumentEnabled(String mimeType, int flags);
        void initDocumentHolder(DocumentHolder holder);
        void onBindDocumentHolder(DocumentHolder holder, Cursor cursor);
+0 −5
Original line number Diff line number Diff line
@@ -88,9 +88,4 @@ public final class TestEnvironment implements DocumentsAdapter.Environment {
    @Override
    public void onBindDocumentHolder(DocumentHolder holder, Cursor cursor) {
    }

    @Override
    public String getCallingAppName() {
        return "unknown";
    }
}
Loading