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

Commit 151ff22a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8547970 from 1dd0d22f to tm-release

Change-Id: I53a88cc8c505f225a6c68e1e20d1bcf2ddb15aba
parents 22609969 1dd0d22f
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -114,6 +114,20 @@ static const Lc3Capabilities kLc3Capability_16_2 = {
    .frameDurationUs = {10000},
    .octetsPerFrame = {40}};

// Default Supported Codecs
// LC3 24_2: sample rate: 24 kHz, frame duration: 10 ms, octets per frame: 60
static const Lc3Capabilities kLc3Capability_24_2 = {
    .samplingFrequencyHz = {24000},
    .frameDurationUs = {10000},
    .octetsPerFrame = {60}};

// Default Supported Codecs
// LC3 32_2: sample rate: 32 kHz, frame duration: 10 ms, octets per frame: 80
static const Lc3Capabilities kLc3Capability_32_2 = {
    .samplingFrequencyHz = {32000},
    .frameDurationUs = {10000},
    .octetsPerFrame = {80}};

// Default Supported Codecs
// LC3 48_4: sample rate: 48 kHz, frame duration: 10 ms, octets per frame: 120
static const Lc3Capabilities kLc3Capability_48_4 = {
@@ -122,7 +136,8 @@ static const Lc3Capabilities kLc3Capability_48_4 = {
    .octetsPerFrame = {120}};

static const std::vector<Lc3Capabilities> supportedLc3CapabilityList = {
    kLc3Capability_48_4, kLc3Capability_16_2, kLc3Capability_16_1};
    kLc3Capability_48_4, kLc3Capability_32_2, kLc3Capability_24_2,
    kLc3Capability_16_2, kLc3Capability_16_1};

static AudioLocation stereoAudio = static_cast<AudioLocation>(
    static_cast<uint8_t>(AudioLocation::FRONT_LEFT) |
+1 −1
Original line number Diff line number Diff line
@@ -543,7 +543,7 @@ enum CameraMetadataTag {
     * android.flash.info.strengthDefaultLevel [static, int32, public]
     *
     * <p>Default flashlight brightness level to be set via
     * {android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel}.</p>
     * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#turnOnTorchWithStrengthLevel">CameraManager#turnOnTorchWithStrengthLevel</a>.</p>
     */
    ANDROID_FLASH_INFO_STRENGTH_DEFAULT_LEVEL,
    /**
+64 −31
Original line number Diff line number Diff line
@@ -57,6 +57,15 @@ class SecureElementProvisioningTest : public testing::Test {
        }
    }

    int32_t AidlVersion(shared_ptr<IKeyMintDevice> keymint) {
        int32_t version = 0;
        auto status = keymint->getInterfaceVersion(&version);
        if (!status.isOk()) {
            ADD_FAILURE() << "Failed to determine interface version";
        }
        return version;
    }

    static map<SecurityLevel, shared_ptr<IKeyMintDevice>> keymints_;
};

@@ -73,12 +82,14 @@ TEST_F(SecureElementProvisioningTest, ValidConfigurations) {
}

TEST_F(SecureElementProvisioningTest, TeeOnly) {
    if (keymints_.empty()) {
        GTEST_SKIP() << "Test not applicable to device with no KeyMint devices";
    if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) {
        GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device";
    }
    ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1);
    auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second;
    ASSERT_NE(tee, nullptr);
    // Execute the test only for KeyMint version >= 2.
    if (AidlVersion(tee) < 2) {
        GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2";
    }

    array<uint8_t, 16> challenge1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    array<uint8_t, 16> challenge2 = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -111,12 +122,14 @@ TEST_F(SecureElementProvisioningTest, TeeOnly) {
}

TEST_F(SecureElementProvisioningTest, TeeDoesNotImplementStrongBoxMethods) {
    if (keymints_.empty()) {
        GTEST_SKIP() << "Test not applicable to device with no KeyMint devices";
    if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) {
        GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device";
    }
    ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1);
    auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second;
    ASSERT_NE(tee, nullptr);
    // Execute the test only for KeyMint version >= 2.
    if (AidlVersion(tee) < 2) {
        GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2";
    }

    array<uint8_t, 16> challenge;
    Status result = tee->getRootOfTrustChallenge(&challenge);
@@ -135,9 +148,11 @@ TEST_F(SecureElementProvisioningTest, StrongBoxDoesNotImplementTeeMethods) {
        // Need a StrongBox to provision.
        GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device";
    }

    // Execute the test only for KeyMint version >= 2.
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    ASSERT_NE(sb, nullptr);
    if (AidlVersion(sb) < 2) {
        GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2";
    }

    vector<uint8_t> rootOfTrust;
    Status result = sb->getRootOfTrust({}, &rootOfTrust);
@@ -151,14 +166,19 @@ TEST_F(SecureElementProvisioningTest, UnimplementedTest) {
        // Need a StrongBox to provision.
        GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device";
    }
    // Execute the test only for KeyMint version >= 2.
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    if (AidlVersion(sb) < 2) {
        GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2";
    }

    ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1);
    if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) {
        GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device";
    }
    auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second;
    ASSERT_NE(tee, nullptr);

    ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1);
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    ASSERT_NE(sb, nullptr);
    if (AidlVersion(tee) < 2) {
        GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2";
    }

    array<uint8_t, 16> challenge;
    Status result = sb->getRootOfTrustChallenge(&challenge);
@@ -185,10 +205,11 @@ TEST_F(SecureElementProvisioningTest, ChallengeQualityTest) {
        // Need a StrongBox to provision.
        GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device";
    }

    ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1);
    // Execute the test only for KeyMint version >= 2.
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    ASSERT_NE(sb, nullptr);
    if (AidlVersion(sb) < 2) {
        GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2";
    }

    array<uint8_t, 16> challenge1;
    Status result = sb->getRootOfTrustChallenge(&challenge1);
@@ -208,14 +229,20 @@ TEST_F(SecureElementProvisioningTest, ProvisioningTest) {
        // Need a StrongBox to provision.
        GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device";
    }
    // Execute the test only for KeyMint version >= 2.
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    if (AidlVersion(sb) < 2) {
        GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2";
    }

    ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1);
    if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) {
        GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device";
    }
    // Execute the test only for KeyMint version >= 2.
    auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second;
    ASSERT_NE(tee, nullptr);

    ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1);
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    ASSERT_NE(sb, nullptr);
    if (AidlVersion(tee) < 2) {
        GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2";
    }

    array<uint8_t, 16> challenge;
    Status result = sb->getRootOfTrustChallenge(&challenge);
@@ -240,14 +267,20 @@ TEST_F(SecureElementProvisioningTest, InvalidProvisioningTest) {
        // Need a StrongBox to provision.
        GTEST_SKIP() << "Test not applicable to device with no StrongBox KeyMint device";
    }
    // Execute the test only for KeyMint version >= 2.
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    if (AidlVersion(sb) < 2) {
        GTEST_SKIP() << "Test not applicable to StrongBox KeyMint device before v2";
    }

    ASSERT_EQ(keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT), 1);
    if (keymints_.count(SecurityLevel::TRUSTED_ENVIRONMENT) == 0) {
        GTEST_SKIP() << "Test not applicable to device with no TEE KeyMint device";
    }
    // Execute the test only for KeyMint version >= 2.
    auto tee = keymints_.find(SecurityLevel::TRUSTED_ENVIRONMENT)->second;
    ASSERT_NE(tee, nullptr);

    ASSERT_EQ(keymints_.count(SecurityLevel::STRONGBOX), 1);
    auto sb = keymints_.find(SecurityLevel::STRONGBOX)->second;
    ASSERT_NE(sb, nullptr);
    if (AidlVersion(tee) < 2) {
        GTEST_SKIP() << "Test not applicable to TEE KeyMint device before v2";
    }

    array<uint8_t, 16> challenge;
    Status result = sb->getRootOfTrustChallenge(&challenge);