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

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

Make change and version bump to r_aml_300801900 for mainline module file:...

Make change and version bump to r_aml_300801900 for mainline module file: packages/Tethering/apex/manifest.json

Change-Id: I357be5bdb76f6276711e39743d88974b7d1cf248
parents b974022e 194473f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.extservices",
  "version": 300801800
  "version": 300801900
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.permission",
  "version": 300801800
  "version": 300801900
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "com.android.os.statsd",
  "version": 300801800
  "version": 300801900
}
+109 −0
Original line number Diff line number Diff line
@@ -482,6 +482,7 @@ message Atom {
        BlobLeased blob_leased = 299 [(module) = "framework"];
        BlobOpened blob_opened = 300 [(module) = "framework"];
        ContactsProviderStatusReported contacts_provider_status_reported = 301;
        KeystoreKeyEventReported keystore_key_event_reported = 302;

        // StatsdStats tracks platform atoms with ids upto 500.
        // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
@@ -10926,6 +10927,114 @@ message MediametricsAudioDeviceConnectionReported {
    optional int32 connection_count = 6;
}

/**
 * Logs: i) creation of different types of cryptographic keys in the keystore,
 * ii) operations performed using the keys,
 * iii) attestation of the keys
 * Logged from: system/security/keystore/key_event_log_handler.cpp
 */
message KeystoreKeyEventReported {

    enum Algorithm {
        /** Asymmetric algorithms. */
        RSA = 1;
        // 2 removed, do not reuse.
        EC = 3;
        /** Block cipher algorithms */
        AES = 32;
        TRIPLE_DES = 33;
        /** MAC algorithms */
        HMAC = 128;
    };
    /** Algorithm associated with the key */
    optional Algorithm algorithm = 1;

    /** Size of the key */
    optional int32 key_size = 2;

    enum KeyOrigin {
        /** Generated in keymaster.  Should not exist outside the TEE. */
        GENERATED = 0;
        /** Derived inside keymaster.  Likely exists off-device. */
        DERIVED = 1;
        /** Imported into keymaster.  Existed as cleartext in Android. */
        IMPORTED = 2;
        /** Keymaster did not record origin. */
        UNKNOWN = 3;
        /** Securely imported into Keymaster. */
        SECURELY_IMPORTED = 4;
    };
    /* Logs whether the key was generated, imported, securely imported, or derived.*/
    optional KeyOrigin key_origin = 3;

    enum HardwareAuthenticatorType {
        NONE = 0;
        PASSWORD = 1;
        FINGERPRINT = 2;
        // Additional entries must be powers of 2.
    };
    /**
     * What auth types does this key require? If none,
     * then no auth required.
     */
    optional HardwareAuthenticatorType user_auth_type = 4;

    /**
     * If user authentication is required, is the requirement time based? If it
     * is not time based then this field will not be used and the key is per
     * operation. Per operation keys must be user authenticated on each usage.
     */
    optional int32 user_auth_key_timeout_secs = 5;

    /**
     * padding mode, digest, block_mode and purpose should ideally be repeated
     * fields. However, since statsd does not support repeated fields in
     * pushed atoms, they are represented using bitmaps.
     */

    /** Track which padding mode is being used.*/
    optional int32 padding_mode_bitmap = 6;

    /** Track which digest is being used. */
    optional int32 digest_bitmap = 7;

    /** Track what block mode is being used (for encryption). */
    optional int32 block_mode_bitmap = 8;

    /** Track what purpose is this key serving. */
    optional int32 purpose_bitmap = 9;

    enum EcCurve {
        P_224 = 0;
        P_256 = 1;
        P_384 = 2;
        P_521 = 3;
    };
    /** Which ec curve was selected if elliptic curve cryptography is in use **/
    optional EcCurve ec_curve = 10;

    enum KeyBlobUsageRequirements {
        STANDALONE = 0;
        REQUIRES_FILE_SYSTEM = 1;
    };
    /** Standalone or is a file system required */
    optional KeyBlobUsageRequirements key_blob_usage_reqs = 11;

    enum Type {
        key_operation = 0;
        key_creation = 1;
        key_attestation = 2;
    }
    /** Key creation event, operation event or attestation event? */
    optional Type type = 12;

    /** Was the key creation, operation, or attestation successful? */
    optional bool was_successful = 13;

    /** Response code or error code */
    optional int32 error_code = 14;
}

// Blob Committer stats
// Keep in sync between:
//     frameworks/base/core/proto/android/server/blobstoremanagerservice.proto
+76 −28
Original line number Diff line number Diff line
@@ -33,6 +33,12 @@ namespace android {
namespace os {
namespace statsd {

// These constants must be kept in sync with those in StatsDimensionsValue.java.
const static int STATS_DIMENSIONS_VALUE_STRING_TYPE = 2;
const static int STATS_DIMENSIONS_VALUE_INT_TYPE = 3;
const static int STATS_DIMENSIONS_VALUE_FLOAT_TYPE = 6;
const static int STATS_DIMENSIONS_VALUE_TUPLE_TYPE = 7;

namespace {
void makeLogEvent(LogEvent* logEvent, const int32_t atomId, const int64_t timestamp,
                  const vector<int>& attributionUids, const vector<string>& attributionTags,
@@ -291,34 +297,76 @@ TEST(AtomMatcherTest, TestWriteDimensionPath) {
    }
}

//TODO(b/149050405) Update this test for StatsDimensionValueParcel
//TEST(AtomMatcherTest, TestSubscriberDimensionWrite) {
//    HashableDimensionKey dim;
//
//    int pos1[] = {1, 1, 1};
//    int pos2[] = {1, 1, 2};
//    int pos3[] = {1, 1, 3};
//    int pos4[] = {2, 0, 0};
//
//    Field field1(10, pos1, 2);
//    Field field2(10, pos2, 2);
//    Field field3(10, pos3, 2);
//    Field field4(10, pos4, 0);
//
//    Value value1((int32_t)10025);
//    Value value2("tag");
//    Value value3((int32_t)987654);
//    Value value4((int32_t)99999);
//
//    dim.addValue(FieldValue(field1, value1));
//    dim.addValue(FieldValue(field2, value2));
//    dim.addValue(FieldValue(field3, value3));
//    dim.addValue(FieldValue(field4, value4));
//
//    SubscriberReporter::getStatsDimensionsValue(dim);
//    // TODO(b/110562792): can't test anything here because StatsDimensionsValue class doesn't
//    // have any read api.
//}
void checkAttributionNodeInDimensionsValueParcel(StatsDimensionsValueParcel& attributionNodeParcel,
                                                 int32_t nodeDepthInAttributionChain,
                                                 int32_t uid, string tag) {
    EXPECT_EQ(attributionNodeParcel.field, nodeDepthInAttributionChain /*position at depth 1*/);
    ASSERT_EQ(attributionNodeParcel.valueType, STATS_DIMENSIONS_VALUE_TUPLE_TYPE);
    ASSERT_EQ(attributionNodeParcel.tupleValue.size(), 2);

    StatsDimensionsValueParcel uidParcel = attributionNodeParcel.tupleValue[0];
    EXPECT_EQ(uidParcel.field, 1 /*position at depth 2*/);
    EXPECT_EQ(uidParcel.valueType, STATS_DIMENSIONS_VALUE_INT_TYPE);
    EXPECT_EQ(uidParcel.intValue, uid);

    StatsDimensionsValueParcel tagParcel = attributionNodeParcel.tupleValue[1];
    EXPECT_EQ(tagParcel.field, 2 /*position at depth 2*/);
    EXPECT_EQ(tagParcel.valueType, STATS_DIMENSIONS_VALUE_STRING_TYPE);
    EXPECT_EQ(tagParcel.stringValue, tag);
}

// Test conversion of a HashableDimensionKey into a StatsDimensionValueParcel
TEST(AtomMatcherTest, TestSubscriberDimensionWrite) {
    int atomId = 10;
    // First four fields form an attribution chain
    int pos1[] = {1, 1, 1};
    int pos2[] = {1, 1, 2};
    int pos3[] = {1, 2, 1};
    int pos4[] = {1, 2, 2};
    int pos5[] = {2, 1, 1};

    Field field1(atomId, pos1, /*depth=*/2);
    Field field2(atomId, pos2, /*depth=*/2);
    Field field3(atomId, pos3, /*depth=*/2);
    Field field4(atomId, pos4, /*depth=*/2);
    Field field5(atomId, pos5, /*depth=*/0);

    Value value1((int32_t)1);
    Value value2("string2");
    Value value3((int32_t)3);
    Value value4("string4");
    Value value5((float)5.0);

    HashableDimensionKey dimensionKey;
    dimensionKey.addValue(FieldValue(field1, value1));
    dimensionKey.addValue(FieldValue(field2, value2));
    dimensionKey.addValue(FieldValue(field3, value3));
    dimensionKey.addValue(FieldValue(field4, value4));
    dimensionKey.addValue(FieldValue(field5, value5));

    StatsDimensionsValueParcel rootParcel = dimensionKey.toStatsDimensionsValueParcel();
    EXPECT_EQ(rootParcel.field, atomId);
    ASSERT_EQ(rootParcel.valueType, STATS_DIMENSIONS_VALUE_TUPLE_TYPE);
    ASSERT_EQ(rootParcel.tupleValue.size(), 2);

    // Check that attribution chain is populated correctly
    StatsDimensionsValueParcel attributionChainParcel = rootParcel.tupleValue[0];
    EXPECT_EQ(attributionChainParcel.field, 1 /*position at depth 0*/);
    ASSERT_EQ(attributionChainParcel.valueType, STATS_DIMENSIONS_VALUE_TUPLE_TYPE);
    ASSERT_EQ(attributionChainParcel.tupleValue.size(), 2);
    checkAttributionNodeInDimensionsValueParcel(attributionChainParcel.tupleValue[0],
                                                /*nodeDepthInAttributionChain=*/1,
                                                value1.int_value, value2.str_value);
    checkAttributionNodeInDimensionsValueParcel(attributionChainParcel.tupleValue[1],
                                                /*nodeDepthInAttributionChain=*/2,
                                                value3.int_value, value4.str_value);

    // Check that the float is populated correctly
    StatsDimensionsValueParcel floatParcel = rootParcel.tupleValue[1];
    EXPECT_EQ(floatParcel.field, 2 /*position at depth 0*/);
    EXPECT_EQ(floatParcel.valueType, STATS_DIMENSIONS_VALUE_FLOAT_TYPE);
    EXPECT_EQ(floatParcel.floatValue, value5.float_value);
}

TEST(AtomMatcherTest, TestWriteDimensionToProto) {
    HashableDimensionKey dim;
Loading