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

Commit 9819f577 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [12620612, 12620613, 12620936, 12620457, 12616684,...

Merge cherrypicks of [12620612, 12620613, 12620936, 12620457, 12616684, 12621005, 12620883, 12620884, 12620846, 12620847, 12620869, 12620848, 12620849, 12620961, 12620962, 12620827, 12620614, 12620197, 12620885, 12620198, 12621039, 12621040, 12621041, 12620937, 12620615, 12620886] into rvc-release

Change-Id: I0d6914fa9ddf68ed7bd63a4621e5e2a6c10ad1b2
parents f5184a65 aaf6b40e
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ public class ActivityView extends ViewGroup implements android.window.TaskEmbedd
    public ActivityView(
            @NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
            boolean singleTaskInstance, boolean usePublicVirtualDisplay) {
        this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay, false);
        this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay,
                false /* disableSurfaceViewBackgroundLayer */);
    }

    /** @hide */
@@ -113,12 +114,22 @@ public class ActivityView extends ViewGroup implements android.window.TaskEmbedd
            @NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
            boolean singleTaskInstance, boolean usePublicVirtualDisplay,
            boolean disableSurfaceViewBackgroundLayer) {
        this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay,
                disableSurfaceViewBackgroundLayer, false /* useTrustedDisplay */);
    }

    // TODO(b/162901735): Refactor ActivityView with Builder
    /** @hide */
    public ActivityView(
            @NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
            boolean singleTaskInstance, boolean usePublicVirtualDisplay,
            boolean disableSurfaceViewBackgroundLayer, boolean useTrustedDisplay) {
        super(context, attrs, defStyle);
        if (useTaskOrganizer()) {
            mTaskEmbedder = new TaskOrganizerTaskEmbedder(context, this);
        } else {
            mTaskEmbedder = new VirtualDisplayTaskEmbedder(context, this, singleTaskInstance,
                    usePublicVirtualDisplay);
                    usePublicVirtualDisplay, useTrustedDisplay);
        }
        mSurfaceView = new SurfaceView(context, null, 0, 0, disableSurfaceViewBackgroundLayer);
        // Since ActivityView#getAlpha has been overridden, we should use parent class's alpha
+3 −3
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ public class Notification implements Parcelable
     * <p>
     * Avoids spamming the system with overly large strings such as full e-mails.
     */
    private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024;
    private static final int MAX_CHARSEQUENCE_LENGTH = 1024;

    /**
     * Maximum entries of reply text that are accepted by Builder and friends.
@@ -7830,7 +7830,7 @@ public class Notification implements Parcelable
             */
            public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender,
                    boolean remoteInputHistory) {
                mText = text;
                mText = safeCharSequence(text);
                mTimestamp = timestamp;
                mSender = sender;
                mRemoteInputHistory = remoteInputHistory;
@@ -7944,7 +7944,7 @@ public class Notification implements Parcelable
                bundle.putLong(KEY_TIMESTAMP, mTimestamp);
                if (mSender != null) {
                    // Legacy listeners need this
                    bundle.putCharSequence(KEY_SENDER, mSender.getName());
                    bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName()));
                    bundle.putParcelable(KEY_SENDER_PERSON, mSender);
                }
                if (mDataMimeType != null) {
+6 −5
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.icu.util.ULocale;

import com.android.internal.annotations.GuardedBy;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
@@ -151,18 +152,18 @@ public final class LocaleList implements Parcelable {
    /**
     * Creates a new {@link LocaleList}.
     *
     * If two or more same locales are passed, the repeated locales will be dropped.
     * <p>For empty lists of {@link Locale} items it is better to use {@link #getEmptyLocaleList()},
     * which returns a pre-constructed empty list.</p>
     *
     * @throws NullPointerException if any of the input locales is <code>null</code>.
     * @throws IllegalArgumentException if any of the input locales repeat.
     */
    public LocaleList(@NonNull Locale... list) {
        if (list.length == 0) {
            mList = sEmptyList;
            mStringRepresentation = "";
        } else {
            final Locale[] localeList = new Locale[list.length];
            final ArrayList<Locale> localeList = new ArrayList<>();
            final HashSet<Locale> seenLocales = new HashSet<Locale>();
            final StringBuilder sb = new StringBuilder();
            for (int i = 0; i < list.length; i++) {
@@ -170,10 +171,10 @@ public final class LocaleList implements Parcelable {
                if (l == null) {
                    throw new NullPointerException("list[" + i + "] is null");
                } else if (seenLocales.contains(l)) {
                    throw new IllegalArgumentException("list[" + i + "] is a repetition");
                    // Dropping duplicated locale entries.
                } else {
                    final Locale localeClone = (Locale) l.clone();
                    localeList[i] = localeClone;
                    localeList.add(localeClone);
                    sb.append(localeClone.toLanguageTag());
                    if (i < list.length - 1) {
                        sb.append(',');
@@ -181,7 +182,7 @@ public final class LocaleList implements Parcelable {
                    seenLocales.add(localeClone);
                }
            }
            mList = localeList;
            mList = localeList.toArray(new Locale[localeList.size()]);
            mStringRepresentation = sb.toString();
        }
    }
+8 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.window;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_TRUSTED;
import static android.view.Display.INVALID_DISPLAY;

import android.app.ActivityManager;
@@ -63,6 +64,7 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
    private int mDisplayDensityDpi;
    private final boolean mSingleTaskInstance;
    private final boolean mUsePublicVirtualDisplay;
    private final boolean mUseTrustedDisplay;
    private VirtualDisplay mVirtualDisplay;
    private Insets mForwardedInsets;
    private DisplayMetrics mTmpDisplayMetrics;
@@ -77,10 +79,12 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
     *                           only applicable if virtual displays are used
     */
    public VirtualDisplayTaskEmbedder(Context context, VirtualDisplayTaskEmbedder.Host host,
            boolean singleTaskInstance, boolean usePublicVirtualDisplay) {
            boolean singleTaskInstance, boolean usePublicVirtualDisplay,
            boolean useTrustedDisplay) {
        super(context, host);
        mSingleTaskInstance = singleTaskInstance;
        mUsePublicVirtualDisplay = usePublicVirtualDisplay;
        mUseTrustedDisplay = useTrustedDisplay;
    }

    /**
@@ -103,6 +107,9 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
        if (mUsePublicVirtualDisplay) {
            virtualDisplayFlags |= VIRTUAL_DISPLAY_FLAG_PUBLIC;
        }
        if (mUseTrustedDisplay) {
            virtualDisplayFlags |= VIRTUAL_DISPLAY_FLAG_TRUSTED;
        }

        mVirtualDisplay = displayManager.createVirtualDisplay(
                DISPLAY_NAME + "@" + System.identityHashCode(this), mHost.getWidth(),
+1 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@
    <!-- virtual display test permissions -->
    <uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" />
    <uses-permission android:name="android.permission.ADD_TRUSTED_DISPLAY" />

    <!-- color extraction test permissions -->
    <uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
Loading