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

Unverified Commit 8295a1e7 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-13.0.0_r23' into staging/lineage-20.0_android-security-13.0.0_r23

Android security 13.0.0 release 23

* tag 'android-security-13.0.0_r23':
  Restrict access to directories
  RESTRICT AUTOMERGE Clear app-provided shortcut icons
  Disallow device admin package and protected packages to be reinstalled as instant.
  Set no data transfer on function switch timeout for accessory mode
  Check more URIs in notifications
  RingtoneManager: allow video ringtone URI
  Remove authenticator data if it was disabled.

Change-Id: I06facb522f9f84cff97eb166ed3ed4f9fc282e1f
parents 97ee8d83 cfc0443b
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -2854,7 +2854,7 @@ public class Notification implements Parcelable
                    Person.class);
            if (people != null && !people.isEmpty()) {
                for (Person p : people) {
                    visitor.accept(p.getIconUri());
                    p.visitUris(visitor);
                }
            }
@@ -2874,7 +2874,7 @@ public class Notification implements Parcelable
            // Notification Listeners might use directly (without the isStyle check).
            final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
            if (person != null) {
                visitor.accept(person.getIconUri());
                person.visitUris(visitor);
            }
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES,
@@ -2882,12 +2882,7 @@ public class Notification implements Parcelable
            if (!ArrayUtils.isEmpty(messages)) {
                for (MessagingStyle.Message message : MessagingStyle.Message
                        .getMessagesFromBundleArray(messages)) {
                    visitor.accept(message.getDataUri());
                    Person senderPerson = message.getSenderPerson();
                    if (senderPerson != null) {
                        visitor.accept(senderPerson.getIconUri());
                    }
                    message.visitUris(visitor);
                }
            }
@@ -2896,12 +2891,7 @@ public class Notification implements Parcelable
            if (!ArrayUtils.isEmpty(historic)) {
                for (MessagingStyle.Message message : MessagingStyle.Message
                        .getMessagesFromBundleArray(historic)) {
                    visitor.accept(message.getDataUri());
                    Person senderPerson = message.getSenderPerson();
                    if (senderPerson != null) {
                        visitor.accept(senderPerson.getIconUri());
                    }
                    message.visitUris(visitor);
                }
            }
@@ -2910,7 +2900,7 @@ public class Notification implements Parcelable
            // Extras for CallStyle (same reason for visiting without checking isStyle).
            Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON, Person.class);
            if (callPerson != null) {
                visitor.accept(callPerson.getIconUri());
                callPerson.visitUris(visitor);
            }
            visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON, Icon.class));
        }
@@ -8792,6 +8782,18 @@ public class Notification implements Parcelable
                return bundles;
            }
            /**
             * See {@link Notification#visitUris(Consumer)}.
             *
             * @hide
             */
            public void visitUris(@NonNull Consumer<Uri> visitor) {
                visitor.accept(getDataUri());
                if (mSender != null) {
                    mSender.visitUris(visitor);
                }
            }
            /**
             * Returns a list of messages read from the given bundle list, e.g.
             * {@link #EXTRA_MESSAGES} or {@link #EXTRA_HISTORIC_MESSAGES}.
+17 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Parcel;
import android.os.Parcelable;

import java.util.Objects;
import java.util.function.Consumer;

/**
 * Provides an immutable reference to an entity that appears repeatedly on different surfaces of the
@@ -177,6 +178,22 @@ public final class Person implements Parcelable {
        dest.writeBoolean(mIsBot);
    }

    /**
     * Note all {@link Uri} that are referenced internally, with the expectation that Uri permission
     * grants will need to be issued to ensure the recipient of this object is able to render its
     * contents.
     * See b/281044385 for more context and examples about what happens when this isn't done
     * correctly.
     *
     * @hide
     */
    public void visitUris(@NonNull Consumer<Uri> visitor) {
        visitor.accept(getIconUri());
        if (mUri != null && !mUri.isEmpty()) {
            visitor.accept(Uri.parse(mUri));
        }
    }

    /** Builder for the immutable {@link Person} class. */
    public static class Builder {
        @Nullable private CharSequence mName;
+11 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import android.os.Parcelable;
 */
public final class KeyboardShortcutInfo implements Parcelable {
    private final CharSequence mLabel;
    private final Icon mIcon;
    private Icon mIcon;
    private final char mBaseCharacter;
    private final int mKeycode;
    private final int mModifiers;
@@ -115,6 +115,15 @@ public final class KeyboardShortcutInfo implements Parcelable {
        return mIcon;
    }

    /**
     * Removes an icon that was previously set.
     *
     * @hide
     */
    public void clearIcon() {
        mIcon = null;
    }

    /**
     * Returns the base keycode that, combined with the modifiers, triggers this shortcut. If the
     * base character was set instead, returns {@link KeyEvent#KEYCODE_UNKNOWN}. Valid keycodes are
+23 −0
Original line number Diff line number Diff line
@@ -960,6 +960,13 @@ public class RemoteViews implements Parcelable, Filter {
            return SET_REMOTE_VIEW_ADAPTER_LIST_TAG;
        }

        @Override
        public void visitUris(@NonNull Consumer<Uri> visitor) {
            for (RemoteViews remoteViews : list) {
                remoteViews.visitUris(visitor);
            }
        }

        int viewTypeCount;
        ArrayList<RemoteViews> list;
    }
@@ -1082,6 +1089,13 @@ public class RemoteViews implements Parcelable, Filter {
        public int getActionTag() {
            return SET_REMOTE_COLLECTION_ITEMS_ADAPTER_TAG;
        }

        @Override
        public void visitUris(@NonNull Consumer<Uri> visitor) {
            if (mItems != null) {
              mItems.visitUris(visitor);
            }
        }
    }

    private class SetRemoteViewsAdapterIntent extends Action {
@@ -7029,6 +7043,15 @@ public class RemoteViews implements Parcelable, Filter {
                        Math.max(mViewTypeCount, 1));
            }
        }

        /**
         * See {@link RemoteViews#visitUris(Consumer)}.
         */
        private void visitUris(@NonNull Consumer<Uri> visitor) {
            for (RemoteViews view : mViews) {
                view.visitUris(visitor);
            }
        }
    }

    /**
+6 −2
Original line number Diff line number Diff line
@@ -841,9 +841,13 @@ public class RingtoneManager {
                        + " ignored: failure to find mimeType (no access from this context?)");
                return;
            }
            if (!(mimeType.startsWith("audio/") || mimeType.equals("application/ogg"))) {
            if (!(mimeType.startsWith("audio/") || mimeType.equals("application/ogg")
                    || mimeType.equals("application/x-flac")
                    // also check for video ringtones
                    || mimeType.startsWith("video/") || mimeType.equals("application/mp4"))) {
                Log.e(TAG, "setActualDefaultRingtoneUri for URI:" + ringtoneUri
                        + " ignored: associated mimeType:" + mimeType + " is not an audio type");
                        + " ignored: associated MIME type:" + mimeType
                        + " is not a recognized audio or video type");
                return;
            }
        }
Loading