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

Commit 4aa85bc3 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6330721 from c8cc7726 to mainline-release

Change-Id: I818a887e680dd48137b85bb2354717a329e541d6
parents ae4d5741 c8cc7726
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1133,16 +1133,6 @@ aidl_mapping {
    output: "framework-aidl-mappings.txt",
}

genrule {
    name: "framework-annotation-proc-index",
    srcs: [":framework-annotation-proc"],
    cmd: "unzip -qp $(in) unsupportedappusage/unsupportedappusage_index.csv > $(out)",
    out: ["unsupportedappusage_index.csv"],
    dist: {
        targets: ["droidcore"],
    },
}

// Avoid including Parcelable classes as we don't want to have two copies of
// Parcelable cross the libraries. This is used by telephony-common (frameworks/opt/telephony)
// and TeleService app (packages/services/Telephony).
+16 −0
Original line number Diff line number Diff line
@@ -60,6 +60,10 @@ stubs_defaults {
            removed_api_file: "api/removed.txt",
        },
    },
    dist: {
        targets: ["sdk", "win_sdk"],
        dir: "apistubs/android/public/api",
    },
}

stubs_defaults {
@@ -74,6 +78,10 @@ stubs_defaults {
            removed_api_file: "api/system-removed.txt",
        },
    },
    dist: {
        targets: ["sdk", "win_sdk"],
        dir: "apistubs/android/system/api",
    },
}

// The defaults for module_libs comes in two parts - defaults for API checks
@@ -93,6 +101,10 @@ stubs_defaults {
            removed_api_file: "api/module-lib-removed.txt",
        },
    },
    dist: {
        targets: ["sdk", "win_sdk"],
        dir: "apistubs/android/module-lib/api",
    },
}

stubs_defaults {
@@ -113,6 +125,10 @@ stubs_defaults {
            removed_api_file: "api/removed.txt",
        },
    },
    dist: {
        targets: ["sdk", "win_sdk"],
        dir: "apistubs/android/system-server/api",
    },
}

// Empty for now, but a convenient place to add rules for all
+2 −4
Original line number Diff line number Diff line
@@ -563,12 +563,10 @@ public class BlobStoreManager {

    /**
     * Return the {@link BlobHandle BlobHandles} corresponding to the data blobs that
     * the calling app has acquired a lease on using {@link #acquireLease(BlobHandle, int)} or
     * one of it's other variants.
     * the calling app currently has a lease on.
     *
     * @hide
     * @return a list of {@link BlobHandle BlobHandles} that the caller has a lease on.
     */
    @TestApi
    @NonNull
    public List<BlobHandle> getLeasedBlobs() throws IOException {
        try {
+75 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.ParsableByteArray;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.ColorInfo;

import java.io.EOFException;
@@ -60,6 +61,7 @@ import java.io.InterruptedIOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -688,12 +690,83 @@ public final class MediaParser {
     * Returns an immutable list with the names of the parsers that are suitable for container
     * formats with the given {@link MediaFormat}.
     *
     * <p>TODO: List which properties are taken into account. E.g. MimeType.
     * <p>A parser supports a {@link MediaFormat} if the mime type associated with {@link
     * MediaFormat#KEY_MIME} corresponds to the supported container format.
     *
     * @param mediaFormat The {@link MediaFormat} to check support for.
     * @return The parser names that support the given {@code mediaFormat}, or the list of all
     *     parsers available if no container specific format information is provided.
     */
    @NonNull
    @ParserName
    public static List<String> getParserNames(@NonNull MediaFormat mediaFormat) {
        throw new UnsupportedOperationException();
        String mimeType = mediaFormat.getString(MediaFormat.KEY_MIME);
        mimeType = mimeType == null ? null : Util.toLowerInvariant(mimeType.trim());
        if (TextUtils.isEmpty(mimeType)) {
            // No MIME type provided. Return all.
            return Collections.unmodifiableList(
                    new ArrayList<>(EXTRACTOR_FACTORIES_BY_NAME.keySet()));
        }
        ArrayList<String> result = new ArrayList<>();
        switch (mimeType) {
            case "video/x-matroska":
            case "audio/x-matroska":
            case "video/x-webm":
            case "audio/x-webm":
                result.add(PARSER_NAME_MATROSKA);
                break;
            case "video/mp4":
            case "audio/mp4":
            case "application/mp4":
                result.add(PARSER_NAME_MP4);
                result.add(PARSER_NAME_FMP4);
                break;
            case "audio/mpeg":
                result.add(PARSER_NAME_MP3);
                break;
            case "audio/aac":
                result.add(PARSER_NAME_ADTS);
                break;
            case "audio/ac3":
                result.add(PARSER_NAME_AC3);
                break;
            case "video/mp2t":
            case "audio/mp2t":
                result.add(PARSER_NAME_TS);
                break;
            case "video/x-flv":
                result.add(PARSER_NAME_FLV);
                break;
            case "video/ogg":
            case "audio/ogg":
            case "application/ogg":
                result.add(PARSER_NAME_OGG);
                break;
            case "video/mp2p":
            case "video/mp1s":
                result.add(PARSER_NAME_PS);
                break;
            case "audio/vnd.wave":
            case "audio/wav":
            case "audio/wave":
            case "audio/x-wav":
                result.add(PARSER_NAME_WAV);
                break;
            case "audio/amr":
                result.add(PARSER_NAME_AMR);
                break;
            case "audio/ac4":
                result.add(PARSER_NAME_AC4);
                break;
            case "audio/flac":
            case "audio/x-flac":
                result.add(PARSER_NAME_FLAC);
                break;
            default:
                // No parsers support the given mime type. Do nothing.
                break;
        }
        return Collections.unmodifiableList(result);
    }

    // Private fields.
+35 −13
Original line number Diff line number Diff line
@@ -188,6 +188,12 @@ public final class StatsEvent {
    @VisibleForTesting
    public static final int ERROR_ATTRIBUTION_UIDS_TAGS_SIZES_NOT_EQUAL = 0x1000;

    /**
     * @hide
     **/
    @VisibleForTesting
    public static final int ERROR_ATOM_ID_INVALID_POSITION = 0x2000;

    // Size limits.

    /**
@@ -350,19 +356,32 @@ public final class StatsEvent {
            mPos = 0;
            writeTypeId(TYPE_OBJECT);

            // Set mPos to after atom id's location in the buffer.
            // First 2 elements in the buffer are event timestamp followed by the atom id.
            mPos = POS_ATOM_ID + Byte.BYTES + Integer.BYTES;
            mPosLastField = 0;
            mLastType = 0;
            // Write timestamp.
            mPos = POS_TIMESTAMP_NS;
            writeLong(mTimestampNs);
        }

        /**
         * Sets the atom id for this StatsEvent.
         *
         * This should be called immediately after StatsEvent.newBuilder()
         * and should only be called once.
         * Not calling setAtomId will result in ERROR_NO_ATOM_ID.
         * Calling setAtomId out of order will result in ERROR_ATOM_ID_INVALID_POSITION.
         **/
        @NonNull
        public Builder setAtomId(final int atomId) {
            if (0 == mAtomId) {
                mAtomId = atomId;

                if (1 == mNumElements) { // Only timestamp is written so far.
                    writeInt(atomId);
                } else {
                    // setAtomId called out of order.
                    mErrorMask |= ERROR_ATOM_ID_INVALID_POSITION;
                }
            }

            return this;
        }

@@ -557,7 +576,7 @@ public final class StatsEvent {
        public Builder addBooleanAnnotation(
                final byte annotationId, final boolean value) {
            // Ensure there's a field written to annotate.
            if (0 == mPosLastField) {
            if (mNumElements < 2) {
                mErrorMask |= ERROR_ANNOTATION_DOES_NOT_FOLLOW_FIELD;
            } else if (mCurrentAnnotationCount >= MAX_ANNOTATION_COUNT) {
                mErrorMask |= ERROR_TOO_MANY_ANNOTATIONS;
@@ -568,6 +587,7 @@ public final class StatsEvent {
                mCurrentAnnotationCount++;
                writeAnnotationCount();
            }

            return this;
        }

@@ -576,7 +596,7 @@ public final class StatsEvent {
         **/
        @NonNull
        public Builder addIntAnnotation(final byte annotationId, final int value) {
            if (0 == mPosLastField) {
            if (mNumElements < 2) {
                mErrorMask |= ERROR_ANNOTATION_DOES_NOT_FOLLOW_FIELD;
            } else if (mCurrentAnnotationCount >= MAX_ANNOTATION_COUNT) {
                mErrorMask |= ERROR_TOO_MANY_ANNOTATIONS;
@@ -587,6 +607,7 @@ public final class StatsEvent {
                mCurrentAnnotationCount++;
                writeAnnotationCount();
            }

            return this;
        }

@@ -619,19 +640,20 @@ public final class StatsEvent {
                mErrorMask |= ERROR_TOO_MANY_FIELDS;
            }

            int size = mPos;
            mPos = POS_TIMESTAMP_NS;
            writeLong(mTimestampNs);
            writeInt(mAtomId);
            if (0 == mErrorMask) {
                mBuffer.putByte(POS_NUM_ELEMENTS, (byte) mNumElements);
            } else {
                // Write atom id and error mask. Overwrite any annotations for atom Id.
                mPos = POS_ATOM_ID;
                mPos += mBuffer.putByte(mPos, TYPE_INT);
                mPos += mBuffer.putInt(mPos, mAtomId);
                mPos += mBuffer.putByte(mPos, TYPE_ERRORS);
                mPos += mBuffer.putInt(mPos, mErrorMask);
                mBuffer.putByte(POS_NUM_ELEMENTS, (byte) 3);
                size = mPos;
            }

            final int size = mPos;

            if (mUsePooledBuffer) {
                return new StatsEvent(mAtomId, mBuffer, mBuffer.getBytes(), size);
            } else {
Loading