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

Commit 79d8a9bc authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6573866 from dee3bbc8 to rvc-release

Change-Id: I24e10bfc3737033cb44140bb51f181680560d943
parents db24085a dee3bbc8
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -16,9 +16,13 @@

package android.app.blob;

import static android.text.format.Formatter.FLAG_IEC_UNITS;

import android.annotation.NonNull;
import android.app.AppGlobals;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.format.Formatter;

import java.util.Collections;
import java.util.List;
@@ -32,13 +36,15 @@ public final class BlobInfo implements Parcelable {
    private final long mId;
    private final long mExpiryTimeMs;
    private final CharSequence mLabel;
    private final long mSizeBytes;
    private final List<LeaseInfo> mLeaseInfos;

    public BlobInfo(long id, long expiryTimeMs, CharSequence label,
    public BlobInfo(long id, long expiryTimeMs, CharSequence label, long sizeBytes,
            List<LeaseInfo> leaseInfos) {
        mId = id;
        mExpiryTimeMs = expiryTimeMs;
        mLabel = label;
        mSizeBytes = sizeBytes;
        mLeaseInfos = leaseInfos;
    }

@@ -46,6 +52,7 @@ public final class BlobInfo implements Parcelable {
        mId = in.readLong();
        mExpiryTimeMs = in.readLong();
        mLabel = in.readCharSequence();
        mSizeBytes = in.readLong();
        mLeaseInfos = in.readArrayList(null /* classloader */);
    }

@@ -61,6 +68,10 @@ public final class BlobInfo implements Parcelable {
        return mLabel;
    }

    public long getSizeBytes() {
        return mSizeBytes;
    }

    public List<LeaseInfo> getLeases() {
        return Collections.unmodifiableList(mLeaseInfos);
    }
@@ -70,6 +81,7 @@ public final class BlobInfo implements Parcelable {
        dest.writeLong(mId);
        dest.writeLong(mExpiryTimeMs);
        dest.writeCharSequence(mLabel);
        dest.writeLong(mSizeBytes);
        dest.writeList(mLeaseInfos);
    }

@@ -83,10 +95,16 @@ public final class BlobInfo implements Parcelable {
                + "id: " + mId + ","
                + "expiryMs: " + mExpiryTimeMs + ","
                + "label: " + mLabel + ","
                + "size: " + formatBlobSize(mSizeBytes) + ","
                + "leases: " + LeaseInfo.toShortString(mLeaseInfos) + ","
                + "}";
    }

    private static String formatBlobSize(long sizeBytes) {
        return Formatter.formatFileSize(AppGlobals.getInitialApplication(),
                sizeBytes, FLAG_IEC_UNITS);
    }

    @Override
    public int describeContents() {
        return 0;
+2 −1
Original line number Diff line number Diff line
@@ -482,7 +482,8 @@ public class BlobStoreManagerService extends SystemService {
                            descriptionResId, leasee.description));
                });
                blobInfos.add(new BlobInfo(blobMetadata.getBlobId(),
                        blobHandle.getExpiryTimeMillis(), blobHandle.getLabel(), leaseInfos));
                        blobHandle.getExpiryTimeMillis(), blobHandle.getLabel(),
                        blobMetadata.getSize(), leaseInfos));
            });
        }
        return blobInfos;
+58 −2
Original line number Diff line number Diff line
@@ -203,6 +203,15 @@ public final class MediaParser {
        /** Returned by {@link #getDurationMicros()} when the duration is unknown. */
        public static final int UNKNOWN_DURATION = Integer.MIN_VALUE;

        /**
         * For each {@link #getSeekPoints} call, returns a single {@link SeekPoint} whose {@link
         * SeekPoint#timeMicros} matches the requested timestamp, and whose {@link
         * SeekPoint#position} is 0.
         *
         * @hide
         */
        public static final SeekMap DUMMY = new SeekMap(new DummyExoPlayerSeekMap());

        private final com.google.android.exoplayer2.extractor.SeekMap mExoPlayerSeekMap;

        private SeekMap(com.google.android.exoplayer2.extractor.SeekMap exoplayerSeekMap) {
@@ -795,6 +804,18 @@ public final class MediaParser {
     */
    public static final String PARAMETER_EAGERLY_EXPOSE_TRACKTYPE =
            "android.media.mediaparser.eagerlyExposeTrackType";
    /**
     * Sets whether a dummy {@link SeekMap} should be exposed before starting extraction. {@code
     * boolean} expected. Default value is {@code false}.
     *
     * <p>For each {@link SeekMap#getSeekPoints} call, the dummy {@link SeekMap} returns a single
     * {@link SeekPoint} whose {@link SeekPoint#timeMicros} matches the requested timestamp, and
     * whose {@link SeekPoint#position} is 0.
     *
     * @hide
     */
    public static final String PARAMETER_EXPOSE_DUMMY_SEEKMAP =
            "android.media.mediaparser.exposeDummySeekMap";

    // Private constants.

@@ -958,6 +979,7 @@ public final class MediaParser {
    private boolean mIncludeSupplementalData;
    private boolean mIgnoreTimestampOffset;
    private boolean mEagerlyExposeTrackType;
    private boolean mExposeDummySeekMap;
    private String mParserName;
    private Extractor mExtractor;
    private ExtractorInput mExtractorInput;
@@ -1017,6 +1039,9 @@ public final class MediaParser {
        if (PARAMETER_EAGERLY_EXPOSE_TRACKTYPE.equals(parameterName)) {
            mEagerlyExposeTrackType = (boolean) value;
        }
        if (PARAMETER_EXPOSE_DUMMY_SEEKMAP.equals(parameterName)) {
            mExposeDummySeekMap = (boolean) value;
        }
        mParserParameters.put(parameterName, value);
        return this;
    }
@@ -1078,11 +1103,10 @@ public final class MediaParser {
        }
        mExoDataReader.mInputReader = seekableInputReader;

        // TODO: Apply parameters when creating extractor instances.
        if (mExtractor == null) {
            mPendingExtractorInit = true;
            if (!mParserName.equals(PARSER_NAME_UNKNOWN)) {
                mExtractor = createExtractor(mParserName);
                mExtractor.init(new ExtractorOutputAdapter());
            } else {
                for (String parserName : mParserNamesPool) {
                    Extractor extractor = createExtractor(parserName);
@@ -1107,9 +1131,18 @@ public final class MediaParser {
        }

        if (mPendingExtractorInit) {
            if (mExposeDummySeekMap) {
                // We propagate the dummy seek map before initializing the extractor, in case the
                // extractor initialization outputs a seek map.
                mOutputConsumer.onSeekMapFound(SeekMap.DUMMY);
            }
            mExtractor.init(new ExtractorOutputAdapter());
            mPendingExtractorInit = false;
            // We return after initialization to allow clients use any output information before
            // starting actual extraction.
            return true;
        }

        if (isPendingSeek()) {
            mExtractor.seek(mPendingSeekPosition, mPendingSeekTimeMicros);
            removePendingSeek();
@@ -1683,6 +1716,28 @@ public final class MediaParser {
        }
    }

    private static final class DummyExoPlayerSeekMap
            implements com.google.android.exoplayer2.extractor.SeekMap {

        @Override
        public boolean isSeekable() {
            return true;
        }

        @Override
        public long getDurationUs() {
            return C.TIME_UNSET;
        }

        @Override
        public SeekPoints getSeekPoints(long timeUs) {
            com.google.android.exoplayer2.extractor.SeekPoint seekPoint =
                    new com.google.android.exoplayer2.extractor.SeekPoint(
                            timeUs, /* position= */ 0);
            return new SeekPoints(seekPoint, seekPoint);
        }
    }

    /** Creates extractor instances. */
    private interface ExtractorFactory {

@@ -1923,6 +1978,7 @@ public final class MediaParser {
        expectedTypeByParameterName.put(PARAMETER_INCLUDE_SUPPLEMENTAL_DATA, Boolean.class);
        expectedTypeByParameterName.put(PARAMETER_IGNORE_TIMESTAMP_OFFSET, Boolean.class);
        expectedTypeByParameterName.put(PARAMETER_EAGERLY_EXPOSE_TRACKTYPE, Boolean.class);
        expectedTypeByParameterName.put(PARAMETER_EXPOSE_DUMMY_SEEKMAP, Boolean.class);
        EXPECTED_TYPE_BY_PARAMETER_NAME = Collections.unmodifiableMap(expectedTypeByParameterName);
    }
}
+265 −6
Original line number Diff line number Diff line
@@ -450,13 +450,28 @@ message Atom {
        TvCasSessionOpenStatus tv_cas_session_open_status =
            280 [(module) = "framework"];
        AssistantInvocationReported assistant_invocation_reported = 281 [(module) = "framework"];
        DisplayWakeReported display_wake_reported = 282 [(module) = "framework"];
        CarUserHalModifyUserRequestReported car_user_hal_modify_user_request_reported =
            283 [(module) = "car"];
        CarUserHalModifyUserResponseReported car_user_hal_modify_user_response_reported =
            284 [(module) = "car"];
        CarUserHalPostSwitchResponseReported car_user_hal_post_switch_response_reported =
            285 [(module) = "car"];
        CarUserHalInitialUserInfoRequestReported car_user_hal_initial_user_info_request_reported =
            286 [(module) = "car"];
        CarUserHalInitialUserInfoResponseReported car_user_hal_initial_user_info_response_reported =
            287 [(module) = "car"];
        CarUserHalUserAssociationRequestReported car_user_hal_user_association_request_reported =
            288 [(module) = "car"];
        CarUserHalSetUserAssociationResponseReported car_user_hal_set_user_association_response_reported =
            289 [(module) = "car"];

        // StatsdStats tracks platform atoms with ids upto 500.
        // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
    }

    // Pulled events will start at field 10000.
    // Next: 10084
    // Next: 10081
    oneof pulled {
        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
@@ -547,7 +562,7 @@ message Atom {
        SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
        SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
        SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
        DisplayWakeReason display_wake_reason = 10081 [(module) = "framework"];
        //10081 free for use
        DataUsageBytesTransfer data_usage_bytes_transfer = 10082 [(module) = "framework"];
        BytesTransferByTagAndMetered bytes_transfer_by_tag_and_metered =
                10083 [(module) = "framework"];
@@ -8000,6 +8015,245 @@ message CarPowerStateChanged {
    optional State state = 1;
}

/**
 * Logs when Car User Hal is requested to switch/create/remove user.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalModifyUserRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;
    // Request type.
    enum RequestType {
        UNKNOWN = 0;
        // Car user manager requested user switch.
        SWITCH_REQUEST_ANDROID = 1;
        // OEM requested User switch.
        SWITCH_REQUEST_OEM = 2;
        // Hal switch requested after android switch using activity manager.
        SWITCH_REQUEST_LEGACY = 3;
        // Create User
        CREATE_REQUEST = 4;
        // Remove User
        REMOVE_REQUEST = 5;
    }
    optional RequestType request_type = 2;
    // Android User id of the current user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 user_id = 3;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 user_flags = 4;
    // Android User id of the target user for switch/create/remove. It can only
    // be 0, 10, 11 and so on. -1 if not available.
    optional int32 target_user_id = 5;
    // VHAL flags of the target user for switch/create/remove. (-1 if not available)
    optional int32 target_user_flags = 6;
    // Request timeout Milliseconds (-1 if not available)
    optional int32 timeout_millis = 7;
}

/**
 * Logs when Car User Hal responds to switch/create user request.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalModifyUserResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;

    // Hal request status for user switch/create/remove.
    enum HalRequestStatus {
        UNSPECIFIED = 0;
        // Hal request for user switch/create is successful.
        SUCCESS = 1;
        // Hal request for user switch/create failed.
        FAILURE = 2;
    }
    optional HalRequestStatus request_status = 3;
}

/**
 * Logs when post switch response is posted to Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalPostSwitchResponseReported {
    // Request id.
    optional int32 request_id = 1;

    // Android user switch status.
    enum UserSwitchStatus {
        UNKNOWN = 0;
        // Android user switch is successful.
        SUCCESS = 1;
        // Android user switch failed.
        FAILURE = 2;
    }
    optional UserSwitchStatus switch_status = 2;
}

/**
 * Logs when initial user information is requested from Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalInitialUserInfoRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;

    // Request type for initial user information.
    enum InitialUserInfoRequestType {
        UNKNOWN = 0;
        // At the first time Android was booted (or after a factory reset).
        FIRST_BOOT = 1;
        // At the first time Android was booted after the system was updated.
        FIRST_BOOT_AFTER_OTA = 2;
        // When Android was booted "from scratch".
        COLD_BOOT = 3;
        // When Android was resumed after the system was suspended to memory.
        RESUME = 4;
    }
    optional InitialUserInfoRequestType request_type = 2;
    // Request timeout Milliseconds (-1 if not available)
    optional int32 timeout_millis = 3;
}

/**
 * Logs when Car User Hal responds to initial user information requests.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalInitialUserInfoResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;
    // Response for initial user information request.
    enum InitialUserInfoResponseAction {
        UNSPECIFIED = 0;
        // Let the Android System decide what to do.
        DEFAULT = 1;
        // Switch to an existing Android user.
        SWITCH = 2;
        // Create a new Android user (and switch to it).
        CREATE = 3;
    }
    optional InitialUserInfoResponseAction response_action = 3;
    // Android User id of the target user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 target_user = 4;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 target_user_flags = 5;
    // User locales
    optional string user_locales = 6;
}

/**
 * Logs when set user association is requested from Car User Hal.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalUserAssociationRequestReported {
    // Request id for the request.
    optional int32 request_id = 1;
    // Request type.
    enum RequestType {
        UNKNOWN = 0;
        // For setting user association information.
        SET = 1;
        // For getting user association information.
        GET = 2;
    }
    optional RequestType request_type = 2;
    // Android User id of the current user which can only be 0, 10, 11 and so on.
    // -1 if not available.
    optional int32 current_user_id = 3;
    // VHAL flags of the current user. (-1 if not available)
    optional int32 current_user_flags = 4;
    // Number of the set associations requested.
    optional int32 number_associations = 5;
    // Concatenated string for the types from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_types = 6;
    // Concatenated string for the values from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_values = 7;
}

/**
 * Logs when Car User Hal responds to set user association requests.
 *
 * Logged from:
 *   packages/services/Car/service/src/com/android/car/hal/UserHalService.java
 */
message CarUserHalSetUserAssociationResponseReported {
    // Request id of the request associated with the response.
    optional int32 request_id = 1;
    // Car user hal callback status.
    enum CallbackStatus {
        UNKNOWN = 0;
        // Hal response was invalid.
        INVALID = 1;
        // Hal response was ok.
        OK = 2;
        // Hal timeout during set call.
        HAL_SET_TIMEOUT = 3;
        // Hal response timeout.
        HAL_RESPONSE_TIMEOUT = 4;
        // Hal responded with wrong info.
        WRONG_HAL_RESPONSE = 5;
        // Hal is processing multiple requests simultaneously.
        CONCURRENT_OPERATION = 6;
    }
    optional CallbackStatus callback_status = 2;
    // Number of the set associations in the response.
    optional int32 number_associations = 3;
    // Concatenated string for the types from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_types = 4;
    // Concatenated string for the values from set associations request.
    // This is a string converted from an array of integers.
    optional string user_identification_association_values = 5;
}

/**
 * Logs whether GarageMode is entered.
 *
@@ -9817,15 +10071,20 @@ message AccessibilityServiceReported {
    optional android.stats.accessibility.ServiceStatus service_status = 2;
}

message DisplayWakeReason {
/**
 * Logs when display wake up.
 *
 * Logged from:
 *   services/core/java/com/android/server/power/Notifier.java
 */

message DisplayWakeReported {
    // Wake_up_reason code
    // If LOWORD(wake_up_reason) = 0
    //     reference to HIWORD(wake_up_reason) PowerManager.WAKE_REASON_XXX
    //     else reference wake_up_reason to
    //     frameworks/base/services/core/java/com/android/server/power/Notifier.java#DispWakeupReason
    //     services/core/java/com/android/server/power/Notifier.java#onWakeUp
    optional int32 wake_up_reason = 1;
    // Count of wake up by reason
    optional int32 wake_times = 2;
}

/**
+1 −35
Original line number Diff line number Diff line
@@ -601,20 +601,6 @@ public class ActivityManager {
    @TestApi
    public static final int PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 1 << 2;

    // TODO: remove this when development is done.
    // These are debug flags used between OomAdjuster and AppOpsService to detect and report absence
    // of the real flags.
    /** @hide */
    public static final int DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE_Q = 1 << 27;
    /** @hide */
    public static final int DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA_Q = 1 << 28;
    /** @hide */
    public static final int DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 1 << 29;
    /** @hide */
    public static final int DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA = 1 << 30;
    /** @hide */
    public static final int DEBUG_PROCESS_CAPABILITY_FOREGROUND_LOCATION = 1 << 31;

    /** @hide all capabilities, the ORing of all flags in {@link ProcessCapability}*/
    @TestApi
    public static final int PROCESS_CAPABILITY_ALL = PROCESS_CAPABILITY_FOREGROUND_LOCATION
@@ -653,29 +639,9 @@ public class ActivityManager {
     */
    public static void printCapabilitiesFull(PrintWriter pw, @ProcessCapability int caps) {
        printCapabilitiesSummary(pw, caps);
        if ((caps & DEBUG_PROCESS_CAPABILITY_FOREGROUND_LOCATION) != 0) {
            pw.print(" !L");
        }
        if ((caps & DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) {
            pw.print(" !C");
        }
        if ((caps & DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA_Q) != 0) {
            pw.print(" !Cq");
        }
        if ((caps & DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) {
            pw.print(" !M");
        }
        if ((caps & DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE_Q) != 0) {
            pw.print(" !Mq");
        }
        final int remain = caps & ~(PROCESS_CAPABILITY_FOREGROUND_LOCATION
                | PROCESS_CAPABILITY_FOREGROUND_CAMERA
                | PROCESS_CAPABILITY_FOREGROUND_MICROPHONE
                | DEBUG_PROCESS_CAPABILITY_FOREGROUND_LOCATION
                | DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA
                | DEBUG_PROCESS_CAPABILITY_FOREGROUND_CAMERA_Q
                | DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE
                | DEBUG_PROCESS_CAPABILITY_FOREGROUND_MICROPHONE_Q);
                | PROCESS_CAPABILITY_FOREGROUND_MICROPHONE);
        if (remain != 0) {
            pw.print('+');
            pw.print(remain);
Loading