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

Commit 31aa22ce authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [20102054, 20111318, 20112890, 20112181] into tm-qpr1-release.

Change-Id: I5f64396d7269ab1d58d9d96db7792c71729606fe
parents eec01732 6f228219
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -528,6 +528,28 @@ public class BroadcastOptions extends ComponentOptions {
        return mIsAlarmBroadcast;
    }

    /**
     * Did this broadcast originate from a push message from the server?
     *
     * @return true if this broadcast is a push message, false otherwise.
     * @hide
     */
    public boolean isPushMessagingBroadcast() {
        return mTemporaryAppAllowlistReasonCode == PowerExemptionManager.REASON_PUSH_MESSAGING;
    }

    /**
     * Did this broadcast originate from a push message from the server which was over the allowed
     * quota?
     *
     * @return true if this broadcast is a push message over quota, false otherwise.
     * @hide
     */
    public boolean isPushMessagingOverQuotaBroadcast() {
        return mTemporaryAppAllowlistReasonCode
                == PowerExemptionManager.REASON_PUSH_MESSAGING_OVER_QUOTA;
    }

    /** {@hide} */
    public long getRequireCompatChangeId() {
        return mRequireCompatChangeId;
+0 −92
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";
package android.os;

option java_multiple_files = true;

// This message is used for statsd logging and should be kept in sync with
// frameworks/proto_logging/stats/atoms.proto
/**
 * Logs information about process start time.
 *
 * Logged from:
 *      frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
 */
message ProcessStartTime {
  // The uid of the ProcessRecord.
  optional int32 uid = 1;

  // The process pid.
  optional int32 pid = 2;

  // The process name.
  // Usually package name, "system" for system server.
  // Provided by ActivityManagerService.
  optional string process_name = 3;

  enum StartType {
    UNKNOWN = 0;
    WARM = 1;
    HOT = 2;
    COLD = 3;
  }

  // The start type.
  optional StartType type = 4;

  // The elapsed realtime at the start of the process.
  optional int64 process_start_time_millis = 5;

  // Number of milliseconds it takes to reach bind application.
  optional int32 bind_application_delay_millis = 6;

  // Number of milliseconds it takes to finish start of the process.
  optional int32 process_start_delay_millis = 7;

  // hostingType field in ProcessRecord, the component type such as "activity",
  // "service", "content provider", "broadcast" or other strings.
  optional string hosting_type = 8;

  // hostingNameStr field in ProcessRecord. The component class name that runs
  // in this process.
  optional string hosting_name = 9;

  // Broadcast action name.
  optional string broadcast_action_name = 10;

  enum HostingTypeId {
    HOSTING_TYPE_UNKNOWN = 0;
    HOSTING_TYPE_ACTIVITY = 1;
    HOSTING_TYPE_ADDED_APPLICATION = 2;
    HOSTING_TYPE_BACKUP = 3;
    HOSTING_TYPE_BROADCAST = 4;
    HOSTING_TYPE_CONTENT_PROVIDER = 5;
    HOSTING_TYPE_LINK_FAIL = 6;
    HOSTING_TYPE_ON_HOLD = 7;
    HOSTING_TYPE_NEXT_ACTIVITY = 8;
    HOSTING_TYPE_NEXT_TOP_ACTIVITY = 9;
    HOSTING_TYPE_RESTART = 10;
    HOSTING_TYPE_SERVICE = 11;
    HOSTING_TYPE_SYSTEM = 12;
    HOSTING_TYPE_TOP_ACTIVITY = 13;
    HOSTING_TYPE_EMPTY = 14;
  }

  optional HostingTypeId hosting_type_id = 11;
}
+10 −1
Original line number Diff line number Diff line
@@ -4219,7 +4219,8 @@ public final class ActiveServices {
        final String procName = r.processName;
        HostingRecord hostingRecord = new HostingRecord(
                HostingRecord.HOSTING_TYPE_SERVICE, r.instanceName,
                r.definingPackageName, r.definingUid, r.serviceInfo.processName);
                r.definingPackageName, r.definingUid, r.serviceInfo.processName,
                getHostingRecordTriggerType(r));
        ProcessRecord app;

        if (!isolated) {
@@ -4323,6 +4324,14 @@ public final class ActiveServices {
        return null;
    }

    private String getHostingRecordTriggerType(ServiceRecord r) {
        if (Manifest.permission.BIND_JOB_SERVICE.equals(r.permission)
                && r.mRecentCallingUid == SYSTEM_UID) {
            return HostingRecord.TRIGGER_TYPE_JOB;
        }
        return HostingRecord.TRIGGER_TYPE_UNKNOWN;
    }

    private final void requestServiceBindingsLocked(ServiceRecord r, boolean execInFg)
            throws TransactionTooLargeException {
        for (int i=r.bindings.size()-1; i>=0; i--) {
+2 −1
Original line number Diff line number Diff line
@@ -5008,7 +5008,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                hostingRecord.getType(),
                hostingRecord.getName(),
                shortAction,
                HostingRecord.getHostingTypeIdStatsd(hostingRecord.getType()));
                HostingRecord.getHostingTypeIdStatsd(hostingRecord.getType()),
                HostingRecord.getTriggerTypeForStatsd(hostingRecord.getTriggerType()));
        return true;
    }
+11 −1
Original line number Diff line number Diff line
@@ -1921,7 +1921,7 @@ public final class BroadcastQueue {
                info.activityInfo.applicationInfo, true,
                r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,
                new HostingRecord(HostingRecord.HOSTING_TYPE_BROADCAST, r.curComponent,
                        r.intent.getAction()),
                        r.intent.getAction(), getHostingRecordTriggerType(r)),
                isActivityCapable ? ZYGOTE_POLICY_FLAG_LATENCY_SENSITIVE : ZYGOTE_POLICY_FLAG_EMPTY,
                (r.intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0, false);
        if (r.curApp == null) {
@@ -1944,6 +1944,16 @@ public final class BroadcastQueue {
        mPendingBroadcastRecvIndex = recIdx;
    }

    private String getHostingRecordTriggerType(BroadcastRecord r) {
        if (r.alarm) {
            return HostingRecord.TRIGGER_TYPE_ALARM;
        } else if (r.pushMessage) {
            return HostingRecord.TRIGGER_TYPE_PUSH_MESSAGE;
        } else if (r.pushMessageOverQuota) {
            return HostingRecord.TRIGGER_TYPE_PUSH_MESSAGE_OVER_QUOTA;
        }
        return HostingRecord.TRIGGER_TYPE_UNKNOWN;
    }

    @Nullable
    private String getTargetPackage(BroadcastRecord r) {
Loading