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

Commit 303b1cb0 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5582428 from 5d9fede6 to qt-release

Change-Id: I1417646d23e4400c16ce86c48e228f6d94b7124e
parents c74f2e85 5d9fede6
Loading
Loading
Loading
Loading
+93 −0
Original line number Diff line number Diff line
@@ -299,6 +299,10 @@ message Atom {
        CarPowerStateChanged car_power_state_changed = 203;
        GarageModeInfo garage_mode_info = 204;
        TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
        ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
        ContentCaptureServiceEvents content_capture_service_events = 207;
        ContentCaptureSessionEvents content_capture_session_events = 208;
        ContentCaptureFlushed content_capture_flushed = 209;
    }

    // Pulled events will start at field 10000.
@@ -4830,6 +4834,95 @@ message BuildInformation {
    optional string tags = 9;
}

/**
 * Logs information about mismatched caller for content capture.
 *
 * Logged from:
 *   frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
 */
message ContentCaptureCallerMismatchReported {
    optional string intended_package = 1;
    optional string calling_package = 2;
}

/**
 * Logs information about content capture service events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureServiceEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_CONNECTED = 1;
        ON_DISCONNECTED = 2;
        SET_WHITELIST = 3;
        SET_DISABLED = 4;
        ON_USER_DATA_REMOVED = 5;
    }
    optional Event event = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of target.
    // it's a concatenated list of component/package for SET_WHITELIST event
    // separated by " ".
    optional string target_info = 3;
}

/**
 * Logs information about content capture session events.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureSessionEvents {
    // The type of event.
    enum Event {
        UNKNOWN = 0;
        ON_SESSION_STARTED = 1;
        ON_SESSION_FINISHED = 2;
        SESSION_NOT_CREATED = 3;
    }
    optional int32 session_id = 1;
    optional Event event = 2;
    // (n/a on session finished)
    optional int32 state_flags = 3;
    // component/package of content capture service.
    optional string service_info = 4;
    // component/package of app.
    // (n/a on session finished)
    optional string app_info = 5;
    optional bool is_child_session = 6;
}

/**
 * Logs information about session being flushed.
 *
 * Logged from:
 *   frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
 */
message ContentCaptureFlushed {
    optional int32 session_id = 1;
    // component/package of content capture service.
    optional string service_info = 2;
    // component/package of app.
    optional string app_info = 3;
    // session start/finish events
    optional int32 child_session_started = 4;
    optional int32 child_session_finished = 5;
    // count of view events.
    optional int32 view_appeared_count = 6;
    optional int32 view_disappeared_count = 7;
    optional int32 view_text_changed_count = 8;

    // Flush stats.
    optional int32 max_events = 9;
    optional int32 idle_flush_freq = 10;
    optional int32 text_flush_freq = 11;
    optional int32 flush_reason = 12;
}

/**
 * Pulls on-device BatteryStats power use calculations for the overall device.
 */
+2 −0
Original line number Diff line number Diff line
@@ -330,6 +330,8 @@ message IncidentdDetails {

  // Class name of the incident report receiver.
  optional string receiver_cls = 4;

  optional string alert_description = 5;
}

message PerfettoDetails {
+8 −3
Original line number Diff line number Diff line
@@ -36,12 +36,14 @@ namespace statsd {
using android::util::ProtoOutputStream;
using std::vector;

using util::FIELD_TYPE_MESSAGE;
using util::FIELD_TYPE_INT32;
using util::FIELD_TYPE_INT64;
using util::FIELD_TYPE_MESSAGE;
using util::FIELD_TYPE_STRING;

// field ids in IncidentHeaderProto
const int FIELD_ID_ALERT_ID = 1;
const int FIELD_ID_REASON = 2;
const int FIELD_ID_CONFIG_KEY = 3;
const int FIELD_ID_CONFIG_KEY_UID = 1;
const int FIELD_ID_CONFIG_KEY_ID = 2;
@@ -57,9 +59,11 @@ const int FIELD_ID_PACKAGE_INFO = 3;

namespace {
void getProtoData(const int64_t& rule_id, int64_t metricId, const MetricDimensionKey& dimensionKey,
                  int64_t metricValue, const ConfigKey& configKey, vector<uint8_t>* protoData) {
                  int64_t metricValue, const ConfigKey& configKey, const string& reason,
                  vector<uint8_t>* protoData) {
    ProtoOutputStream headerProto;
    headerProto.write(FIELD_TYPE_INT64 | FIELD_ID_ALERT_ID, (long long)rule_id);
    headerProto.write(FIELD_TYPE_STRING | FIELD_ID_REASON, reason);
    uint64_t token =
            headerProto.start(FIELD_TYPE_MESSAGE | FIELD_ID_CONFIG_KEY);
    headerProto.write(FIELD_TYPE_INT32 | FIELD_ID_CONFIG_KEY_UID, configKey.GetUid());
@@ -142,7 +146,8 @@ bool GenerateIncidentReport(const IncidentdDetails& config, int64_t rule_id, int
    IncidentReportArgs incidentReport;

    vector<uint8_t> protoData;
    getProtoData(rule_id, metricId, dimensionKey, metricValue, configKey, &protoData);
    getProtoData(rule_id, metricId, dimensionKey, metricValue, configKey,
                 config.alert_description(), &protoData);
    incidentReport.addHeader(protoData);

    for (int i = 0; i < config.section_size(); i++) {
+2 −2
Original line number Diff line number Diff line
@@ -1920,8 +1920,8 @@ public class ApplicationPackageManager extends PackageManager {
    private int installExistingPackageAsUser(String packageName, int installReason, int userId)
            throws NameNotFoundException {
        try {
            int res = mPM.installExistingPackageAsUser(packageName, userId, 0 /*installFlags*/,
                    installReason);
            int res = mPM.installExistingPackageAsUser(packageName, userId,
                    INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, installReason, null);
            if (res == INSTALL_FAILED_INVALID_URI) {
                throw new NameNotFoundException("Package " + packageName + " doesn't exist");
            }
+5 −0
Original line number Diff line number Diff line
@@ -636,6 +636,11 @@ public class SecurityLog {
        public int hashCode() {
            return Objects.hash(mEvent, mId);
        }

        /** @hide */
        public boolean eventEquals(SecurityEvent other) {
            return other != null && mEvent.equals(other.mEvent);
        }
    }
    /**
     * Retrieve all security logs and return immediately.
Loading