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

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

Snap for 7049271 from 21954797 to sc-release

Change-Id: Ibe74959406403198ef96a77c3b59f16c9021fbd7
parents b23c3fa6 21954797
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2773,7 +2773,7 @@ enum VehicleProperty : int32_t {
     *
     * int32[0]: 42  // request id
     * int32[1]: 11  // Android id of the created user
     * int32[2]: 3   // Android flags (ephemeral guest) of the created user
     * int32[2]: 6   // Android flags (ephemeral guest) of the created user
     * int32[3]: 10  // current user
     * int32[4]: 0   // current user flags (none)
     * int32[5]: 3   // number of users
@@ -2782,7 +2782,7 @@ enum VehicleProperty : int32_t {
     * int32[8]: 10  // 2nd user (user 10)
     * int32[9]: 0   // 2nd user flags (none)
     * int32[19]: 11 // 3rd user (user 11)
     * int32[11]: 3  // 3rd user flags (ephemeral guest)
     * int32[11]: 6  // 3rd user flags (ephemeral guest)
     * string: "ElGuesto" // name of the new user
     *
     * Then if the request succeeded, the HAL would return:
+7 −0
Original line number Diff line number Diff line
@@ -354,6 +354,13 @@
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.memtrack</name>
        <interface>
            <name>IMemtrack</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="true">
        <name>android.hardware.memtrack</name>
        <version>1.0</version>
+8 −5
Original line number Diff line number Diff line
@@ -152,9 +152,9 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {

    void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }

    const native_handle_t* allocate() {
    const native_handle_t* allocate(int32_t width, int32_t height) {
        return mGralloc->allocate(
                /*width*/ 64, /*height*/ 64, /*layerCount*/ 1,
                width, height, /*layerCount*/ 1,
                static_cast<common::V1_1::PixelFormat>(PixelFormat::RGBA_8888),
                static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN));
    }
@@ -407,7 +407,10 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display,
    mComposerClient->setPowerMode(display.get(), V2_1::IComposerClient::PowerMode::ON);
    mComposerClient->setColorMode_2_3(display.get(), ColorMode::NATIVE, RenderIntent::COLORIMETRIC);

    auto handle = allocate();
    IComposerClient::FRect displayCrop = display.getCrop();
    int32_t displayWidth = static_cast<int32_t>(std::ceilf(displayCrop.right - displayCrop.left));
    int32_t displayHeight = static_cast<int32_t>(std::ceilf(displayCrop.bottom - displayCrop.top));
    auto handle = allocate(displayWidth, displayHeight);
    ASSERT_NE(nullptr, handle);

    Layer layer;
@@ -435,7 +438,7 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display,
    ASSERT_EQ(0, mReader->mErrors.size());

    mWriter->selectLayer(layer);
    auto handle2 = allocate();
    auto handle2 = allocate(displayWidth, displayHeight);
    ASSERT_NE(nullptr, handle2);

    mWriter->setLayerBuffer(0, handle2, -1);
+15 −18
Original line number Diff line number Diff line
@@ -935,18 +935,19 @@ bool parseAsn1Time(const ASN1_TIME* asn1Time, time_t* outTime) {
optional<vector<vector<uint8_t>>> createAttestation(
        const EVP_PKEY* key, const vector<uint8_t>& applicationId, const vector<uint8_t>& challenge,
        uint64_t activeTimeMilliSeconds, uint64_t expireTimeMilliSeconds, bool isTestCredential) {
    const keymaster_cert_chain_t* attestation_chain =
            ::keymaster::getAttestationChain(KM_ALGORITHM_EC, nullptr);
    if (attestation_chain == nullptr) {
        LOG(ERROR) << "Error getting attestation chain";
    keymaster_error_t error;
    ::keymaster::CertificateChain attestation_chain =
            ::keymaster::getAttestationChain(KM_ALGORITHM_EC, &error);
    if (KM_ERROR_OK != error) {
        LOG(ERROR) << "Error getting attestation chain " << error;
        return {};
    }
    if (expireTimeMilliSeconds == 0) {
        if (attestation_chain->entry_count < 1) {
        if (attestation_chain.entry_count < 1) {
            LOG(ERROR) << "Expected at least one entry in attestation chain";
            return {};
        }
        keymaster_blob_t* bcBlob = &(attestation_chain->entries[0]);
        keymaster_blob_t* bcBlob = &(attestation_chain.entries[0]);
        const uint8_t* bcData = bcBlob->data;
        auto bc = X509_Ptr(d2i_X509(nullptr, &bcData, bcBlob->data_length));
        time_t bcNotAfter;
@@ -1015,34 +1016,30 @@ optional<vector<vector<uint8_t>>> createAttestation(
    }
    ::keymaster::AuthorizationSet hwEnforced(hwEnforcedBuilder);

    keymaster_error_t error;
    ::keymaster::CertChainPtr cert_chain_out;

    // Pretend to be implemented in a trusted environment just so we can pass
    // the VTS tests. Of course, this is a pretend-only game since hopefully no
    // relying party is ever going to trust our batch key and those keys above
    // it.
    //
    ::keymaster::PureSoftKeymasterContext context(::keymaster::KmVersion::KEYMASTER_4_1,
                                                  KM_SECURITY_LEVEL_TRUSTED_ENVIRONMENT);

    error = generate_attestation_from_EVP(key, swEnforced, hwEnforced, auth_set, context,
                                          *attestation_chain, *attestation_signing_key,
                                          &cert_chain_out);
    ::keymaster::CertificateChain cert_chain_out = generate_attestation_from_EVP(
            key, swEnforced, hwEnforced, auth_set, context, move(attestation_chain),
            *attestation_signing_key, &error);

    if (KM_ERROR_OK != error || !cert_chain_out) {
    if (KM_ERROR_OK != error) {
        LOG(ERROR) << "Error generate attestation from EVP key" << error;
        return {};
    }

    // translate certificate format from keymaster_cert_chain_t to vector<uint8_t>.
    // translate certificate format from keymaster_cert_chain_t to vector<vector<uint8_t>>.
    vector<vector<uint8_t>> attestationCertificate;
    for (int i = 0; i < cert_chain_out->entry_count; i++) {
    for (int i = 0; i < cert_chain_out.entry_count; i++) {
        attestationCertificate.insert(
                attestationCertificate.end(),
                vector<uint8_t>(
                        cert_chain_out->entries[i].data,
                        cert_chain_out->entries[i].data + cert_chain_out->entries[i].data_length));
                        cert_chain_out.entries[i].data,
                        cert_chain_out.entries[i].data + cert_chain_out.entries[i].data_length));
    }

    return attestationCertificate;
+33 −0
Original line number Diff line number Diff line
// Copyright (C) 2020 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.

aidl_interface {
    name: "android.hardware.memtrack",
    vendor_available: true,
    srcs: ["android/hardware/memtrack/*.aidl"],
    stability: "vintf",
    backend: {
        cpp: {
            enabled: false,
        },
        java: {
            enabled: false,
        },
        ndk: {
            vndk: {
                enabled: true,
            },
        },
    },
}
Loading