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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23764937',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23764937', 'googleplex-android-review.googlesource.com/23755569', 'googleplex-android-review.googlesource.com/23768596', 'googleplex-android-review.googlesource.com/23791647', 'googleplex-android-review.googlesource.com/23786112'] into udc-release.

Change-Id: Ib641b118126a1cec2dca1e14b5e1bfd744313295
parents 518ea8eb 35dc6f53
Loading
Loading
Loading
Loading
+25 −11
Original line number Diff line number Diff line
@@ -2003,13 +2003,25 @@ public class Resources {

        private int mHashCode = 0;

        private boolean containsValue(int resId, boolean force) {
        private int findValue(int resId, boolean force) {
            for (int i = 0; i < mCount; ++i) {
                if (mResId[i] == resId && mForce[i] == force) {
                    return true;
                    return i;
                }
            }
            return false;
            return -1;
        }

        private void moveToLast(int index) {
            if (index < 0 || index >= mCount - 1) {
                return;
            }
            final int id = mResId[index];
            final boolean force = mForce[index];
            System.arraycopy(mResId, index + 1, mResId, index, mCount - index - 1);
            mResId[mCount - 1] = id;
            System.arraycopy(mForce, index + 1, mForce, index, mCount - index - 1);
            mForce[mCount - 1] = force;
        }

        public void append(int resId, boolean force) {
@@ -2022,16 +2034,18 @@ public class Resources {
            }

            // Some apps tend to keep adding same resources over and over, let's protect from it.
            if (containsValue(resId, force)) {
                return;
            }

            // Note: the order still matters, as the values that come later override the earlier
            //  ones.
            final int index = findValue(resId, force);
            if (index >= 0) {
                moveToLast(index);
            } else {
                mResId = GrowingArrayUtils.append(mResId, mCount, resId);
                mForce = GrowingArrayUtils.append(mForce, mCount, force);
                mCount++;

                mHashCode = 31 * (31 * mHashCode + resId) + (force ? 1 : 0);
            }
        }

        /**
         * Sets up this key as a deep copy of another key.
+3 −0
Original line number Diff line number Diff line
@@ -856,6 +856,9 @@ public class PipTransition extends PipTransitionController {
        final int enterAnimationType = mEnterAnimationType;
        if (enterAnimationType == ANIM_TYPE_ALPHA) {
            startTransaction.setAlpha(leash, 0f);
        } else {
            // set alpha to 1, because for multi-activity PiP it will create a new task with alpha 0
            startTransaction.setAlpha(leash, 1f);
        }
        startTransaction.apply();

+0 −1
Original line number Diff line number Diff line
@@ -657,7 +657,6 @@ void VulkanManager::destroySurface(VulkanSurface* surface) {
    if (VK_NULL_HANDLE != mGraphicsQueue) {
        mQueueWaitIdle(mGraphicsQueue);
    }
    mDeviceWaitIdle(mDevice);

    delete surface;
}
+14 −24
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ public final class MediaRoute2Info implements Parcelable {
                TYPE_REMOTE_GAME_CONSOLE,
                TYPE_REMOTE_CAR,
                TYPE_REMOTE_SMARTWATCH,
                TYPE_REMOTE_SMARTPHONE,
                TYPE_GROUP
            })
    @Retention(RetentionPolicy.SOURCE)
@@ -342,6 +343,17 @@ public final class MediaRoute2Info implements Parcelable {
     */
    public static final int TYPE_REMOTE_SMARTWATCH = 1009;

    /**
     * Indicates the route is a remote smartphone.
     *
     * <p>A remote device uses a routing protocol managed by the application, as opposed to the
     * routing being done by the system.
     *
     * @see #getType
     * @hide
     */
    public static final int TYPE_REMOTE_SMARTPHONE = 1010;

    /**
     * Indicates the route is a group of devices.
     *
@@ -546,32 +558,8 @@ public final class MediaRoute2Info implements Parcelable {
        return mFeatures;
    }

    // TODO (b/278728942): Add the following once the symbols are published in the SDK. Until then,
    //     adding them would cause the generated link to be broken.
    //     @see #TYPE_REMOTE_TABLET
    //     @see #TYPE_REMOTE_TABLET_DOCKED
    //     @see #TYPE_REMOTE_COMPUTER
    //     @see #TYPE_REMOTE_GAME_CONSOLE
    //     @see #TYPE_REMOTE_CAR
    //     @see #TYPE_REMOTE_SMARTWATCH
    /**
     * Returns the type of this route.
     *
     * @see #TYPE_UNKNOWN
     * @see #TYPE_BUILTIN_SPEAKER
     * @see #TYPE_WIRED_HEADSET
     * @see #TYPE_WIRED_HEADPHONES
     * @see #TYPE_BLUETOOTH_A2DP
     * @see #TYPE_HDMI
     * @see #TYPE_DOCK
     * @see #TYPE_USB_DEVICE
     * @see #TYPE_USB_ACCESSORY
     * @see #TYPE_USB_HEADSET
     * @see #TYPE_HEARING_AID
     * @see #TYPE_REMOTE_TV
     * @see #TYPE_REMOTE_SPEAKER
     * @see #TYPE_REMOTE_AUDIO_VIDEO_RECEIVER
     * @see #TYPE_GROUP
     */
    @Type
    public int getType() {
@@ -954,6 +942,8 @@ public final class MediaRoute2Info implements Parcelable {
                return "REMOTE_CAR";
            case TYPE_REMOTE_SMARTWATCH:
                return "REMOTE_SMARTWATCH";
            case TYPE_REMOTE_SMARTPHONE:
                return "REMOTE_SMARTPHONE";
            case TYPE_GROUP:
                return "GROUP";
            case TYPE_UNKNOWN:
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static android.media.MediaRoute2Info.TYPE_GROUP;
import static android.media.MediaRoute2Info.TYPE_REMOTE_CAR;
import static android.media.MediaRoute2Info.TYPE_REMOTE_COMPUTER;
import static android.media.MediaRoute2Info.TYPE_REMOTE_GAME_CONSOLE;
import static android.media.MediaRoute2Info.TYPE_REMOTE_SMARTPHONE;
import static android.media.MediaRoute2Info.TYPE_REMOTE_SMARTWATCH;
import static android.media.MediaRoute2Info.TYPE_REMOTE_SPEAKER;
import static android.media.MediaRoute2Info.TYPE_REMOTE_TABLET;
@@ -103,6 +104,9 @@ public class InfoMediaDevice extends MediaDevice {
            case TYPE_REMOTE_SMARTWATCH:
                resId = R.drawable.ic_media_smartwatch;
                break;
            case TYPE_REMOTE_SMARTPHONE:
                resId = R.drawable.ic_smartphone;
                break;
            case TYPE_REMOTE_SPEAKER:
            default:
                resId = R.drawable.ic_media_speaker_device;
Loading