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

Commit d41c828c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15541535, 15541187, 15541188, 15541497, 15541189,...

Merge cherrypicks of [15541535, 15541187, 15541188, 15541497, 15541189, 15541499] into security-aosp-oc-mr1-release

Change-Id: I496e2eda4b0c82c19f5b98089ba63a34bfd5dce4
parents 859f03d9 d03d598d
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import java.util.Comparator;
public class PackageItemInfo {
    private static final float MAX_LABEL_SIZE_PX = 500f;
    /** The maximum length of a safe label, in characters */
    private static final int MAX_SAFE_LABEL_LENGTH = 50000;
    private static final int MAX_SAFE_LABEL_LENGTH = 1000;

    /**
     * Public name of this item. From the "android:name" attribute.
@@ -131,6 +131,12 @@ public class PackageItemInfo {
     * item does not have a label, its name is returned.
     */
    public CharSequence loadLabel(PackageManager pm) {
        // Trims the label string to the MAX_SAFE_LABEL_LENGTH. This is to prevent that the
        // system is overwhelmed by an enormous string returned by the application.
        return trimToSize(loadUnsafeLabel(pm), MAX_SAFE_LABEL_LENGTH);
    }

    private CharSequence loadUnsafeLabel(PackageManager pm) {
        if (nonLocalizedLabel != null) {
            return nonLocalizedLabel;
        }
@@ -146,6 +152,15 @@ public class PackageItemInfo {
        return packageName;
    }

    private CharSequence trimToSize(CharSequence label, int size) {
        if (TextUtils.isEmpty(label) || label.length() <= size) return label;
        if (Character.isHighSurrogate(label.charAt(size - 1))
                && Character.isLowSurrogate(label.charAt(size))) {
            size = size - 1;
        }
        return label.subSequence(0, size);
    }

    /**
     * Same as {@link #loadLabel(PackageManager)} with the addition that
     * the returned label is safe for being presented in the UI since it
+2 −0
Original line number Diff line number Diff line
@@ -3376,6 +3376,8 @@
    <string name="deny">Deny</string>
    <string name="permission_request_notification_title">Permission requested</string>
    <string name="permission_request_notification_with_subtitle">Permission requested\nfor account <xliff:g id="account" example="foo@gmail.com">%s</xliff:g>.</string>
     <!-- Title and subtitle for notification shown when app request account access (two lines) [CHAR LIMIT=NONE] -->
    <string name="permission_request_notification_for_app_with_subtitle">Permission requested by <xliff:g id="app" example="Gmail">%1$s</xliff:g>\nfor account <xliff:g id="account" example="foo@gmail.com">%2$s</xliff:g>.</string>

    <!-- Message to show when an intent automatically switches users into the personal profile. -->
    <string name="forward_intent_to_owner">You\'re using this app outside of your work profile</string>
+1 −0
Original line number Diff line number Diff line
@@ -506,6 +506,7 @@
  <java-symbol type="string" name="menu_space_shortcut_label" />
  <java-symbol type="string" name="notification_title" />
  <java-symbol type="string" name="permission_request_notification_with_subtitle" />
  <java-symbol type="string" name="permission_request_notification_for_app_with_subtitle" />
  <java-symbol type="string" name="prepend_shortcut_label" />
  <java-symbol type="string" name="paste_as_plain_text" />
  <java-symbol type="string" name="replace" />
+7 −3
Original line number Diff line number Diff line
@@ -264,15 +264,19 @@ public class VectorDrawable extends Drawable {
    private final Rect mTmpBounds = new Rect();

    public VectorDrawable() {
        this(new VectorDrawableState(null), null);
        this(null, null);
    }

    /**
     * The one constructor to rule them all. This is called by all public
     * constructors to set the state and initialize local properties.
     */
    private VectorDrawable(@NonNull VectorDrawableState state, @Nullable Resources res) {
        mVectorState = state;
    private VectorDrawable(@Nullable VectorDrawableState state, @Nullable Resources res) {
        // As the mutable, not-thread-safe native instance is stored in VectorDrawableState, we
        // need to always do a defensive copy even if mutate() isn't called. Otherwise
        // draw() being called on 2 different VectorDrawable instances could still hit the same
        // underlying native object.
        mVectorState = new VectorDrawableState(state);
        updateLocalState(res);
    }

+3 −1
Original line number Diff line number Diff line
@@ -181,10 +181,12 @@ public class PluginManagerImpl extends BroadcastReceiver implements PluginManage
        IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
        filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
        filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
        filter.addDataScheme("package");
        mContext.registerReceiver(this, filter);
        filter.addAction(PLUGIN_CHANGED);
        filter.addAction(DISABLE_PLUGIN);
        filter.addDataScheme("package");
        mContext.registerReceiver(this, filter);
        mContext.registerReceiver(this, filter, PluginInstanceManager.PLUGIN_PERMISSION, null);
        filter = new IntentFilter(Intent.ACTION_USER_UNLOCKED);
        mContext.registerReceiver(this, filter);
    }
Loading