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

Commit 603a44d9 authored by Xin Li's avatar Xin Li Committed by Gerrit Code Review
Browse files

Merge "Merge RQ2A.210305.007"

parents 4411dc96 9e581928
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -34,11 +34,19 @@ class AuthSecretHidlTest : public testing::TestWithParam<std::string> {
        authsecret = IAuthSecret::getService(GetParam());
        authsecret = IAuthSecret::getService(GetParam());
        ASSERT_NE(authsecret, nullptr);
        ASSERT_NE(authsecret, nullptr);


        // Notify LSS to generate PIN code '1234' and corresponding secret.
        (void)system("cmd lock_settings set-pin 1234");

        // All tests must enroll the correct secret first as this cannot be changed
        // All tests must enroll the correct secret first as this cannot be changed
        // without a factory reset and the order of tests could change.
        // without a factory reset and the order of tests could change.
        authsecret->primaryUserCredential(CORRECT_SECRET);
        authsecret->primaryUserCredential(CORRECT_SECRET);
    }
    }


    static void TearDownTestSuite() {
        // clean up PIN code after testing
        (void)system("cmd lock_settings clear --old 1234");
    }

    sp<IAuthSecret> authsecret;
    sp<IAuthSecret> authsecret;
    hidl_vec<uint8_t> CORRECT_SECRET{61, 93, 124, 240, 5, 0, 7, 201, 9, 129, 11, 12, 0, 14, 0, 16};
    hidl_vec<uint8_t> CORRECT_SECRET{61, 93, 124, 240, 5, 0, 7, 201, 9, 129, 11, 12, 0, 14, 0, 16};
    hidl_vec<uint8_t> WRONG_SECRET{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
    hidl_vec<uint8_t> WRONG_SECRET{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
+21 −5
Original line number Original line Diff line number Diff line
@@ -72,6 +72,8 @@ using ::android::hardware::automotive::evs::V1_1::BufferDesc;
using ::android::hardware::automotive::evs::V1_0::DisplayDesc;
using ::android::hardware::automotive::evs::V1_0::DisplayDesc;
using ::android::hardware::automotive::evs::V1_0::DisplayState;
using ::android::hardware::automotive::evs::V1_0::DisplayState;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
using ::android::hardware::graphics::common::V1_0::PixelFormat;
using ::android::frameworks::automotive::display::V1_0::HwDisplayConfig;
using ::android::frameworks::automotive::display::V1_0::HwDisplayState;
using IEvsCamera_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCamera;
using IEvsCamera_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsCamera;
using IEvsCamera_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCamera;
using IEvsCamera_1_1 = ::android::hardware::automotive::evs::V1_1::IEvsCamera;
using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay;
using IEvsDisplay_1_0 = ::android::hardware::automotive::evs::V1_0::IEvsDisplay;
@@ -303,11 +305,22 @@ TEST_P(EvsHidlTest, CameraOpenClean) {
            const auto id = 0xFFFFFFFF; // meaningless id
            const auto id = 0xFFFFFFFF; // meaningless id
            hidl_vec<uint8_t> values;
            hidl_vec<uint8_t> values;
            auto err = pCam->setExtendedInfo_1_1(id, values);
            auto err = pCam->setExtendedInfo_1_1(id, values);
            if (isLogicalCam) {
                // Logical camera device does not support setExtendedInfo
                // method.
                ASSERT_EQ(EvsResult::INVALID_ARG, err);
            } else {
                ASSERT_NE(EvsResult::INVALID_ARG, err);
                ASSERT_NE(EvsResult::INVALID_ARG, err);
            }


            pCam->getExtendedInfo_1_1(id, [](const auto& result, const auto& data) {

            pCam->getExtendedInfo_1_1(id, [&isLogicalCam](const auto& result, const auto& data) {
                if (isLogicalCam) {
                    ASSERT_EQ(EvsResult::INVALID_ARG, result);
                } else {
                    ASSERT_NE(EvsResult::INVALID_ARG, result);
                    ASSERT_NE(EvsResult::INVALID_ARG, result);
                    ASSERT_EQ(0, data.size());
                    ASSERT_EQ(0, data.size());
                }
            });
            });


            // Explicitly close the camera so resources are released right away
            // Explicitly close the camera so resources are released right away
@@ -605,7 +618,10 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) {
    LOG(INFO) << "Display " << targetDisplayId << " is alreay in use.";
    LOG(INFO) << "Display " << targetDisplayId << " is alreay in use.";


    // Get the display descriptor
    // Get the display descriptor
    pDisplay->getDisplayInfo_1_1([](const auto& config, const auto& state) {
    pDisplay->getDisplayInfo_1_1([](const HwDisplayConfig& config, const HwDisplayState& state) {
        ASSERT_GT(config.size(), 0);
        ASSERT_GT(state.size(), 0);

        android::DisplayConfig* pConfig = (android::DisplayConfig*)config.data();
        android::DisplayConfig* pConfig = (android::DisplayConfig*)config.data();
        const auto width = pConfig->resolution.getWidth();
        const auto width = pConfig->resolution.getWidth();
        const auto height = pConfig->resolution.getHeight();
        const auto height = pConfig->resolution.getHeight();
+0 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,6 @@ cc_library_static {
    local_include_dirs: ["common/include/vhal_v2_0"],
    local_include_dirs: ["common/include/vhal_v2_0"],
    export_include_dirs: ["impl"],
    export_include_dirs: ["impl"],
    srcs: [
    srcs: [
        "impl/vhal_v2_0/EmulatedUserHal.cpp",
        "impl/vhal_v2_0/GeneratorHub.cpp",
        "impl/vhal_v2_0/GeneratorHub.cpp",
        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
        "impl/vhal_v2_0/JsonFakeValueGenerator.cpp",
        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
        "impl/vhal_v2_0/LinearFakeValueGenerator.cpp",
+1 −1
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@ using namespace android::hardware::automotive::vehicle::V2_0;


int main(int /* argc */, char* /* argv */ []) {
int main(int /* argc */, char* /* argv */ []) {
    auto store = std::make_unique<VehiclePropertyStore>();
    auto store = std::make_unique<VehiclePropertyStore>();
    auto connector = impl::makeEmulatedPassthroughConnector();
    auto connector = std::make_unique<impl::EmulatedVehicleConnector>();
    auto userHal = connector->getEmulatedUserHal();
    auto userHal = connector->getEmulatedUserHal();
    auto hal = std::make_unique<impl::EmulatedVehicleHal>(store.get(), connector.get(), userHal);
    auto hal = std::make_unique<impl::EmulatedVehicleHal>(store.get(), connector.get(), userHal);
    auto emulator = std::make_unique<impl::VehicleEmulator>(hal.get());
    auto emulator = std::make_unique<impl::VehicleEmulator>(hal.get());
+1 −1
Original line number Original line Diff line number Diff line
@@ -417,7 +417,7 @@ const ConfigDeclaration kVehicleProperties[]{
                         .minSampleRate = 1.0f,
                         .minSampleRate = 1.0f,
                         .maxSampleRate = 2.0f,
                         .maxSampleRate = 2.0f,
                 },
                 },
         .initialValue = {.floatValues = {100.0f}}},  // units in meters
         .initialValue = {.floatValues = {50000.0f}}},  // units in meters


        {.config =
        {.config =
                 {
                 {
Loading