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

Commit 144675cf authored by Yu Shan's avatar Yu Shan Committed by Android (Google) Code Review
Browse files

Merge "Deprecate DefaultConfig.h."

parents 585a9474 9ba443f0
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 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.
 */

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

cc_library_headers {
    name: "VehicleHalDefaultConfig",
    vendor: true,
    local_include_dirs: ["include"],
    export_include_dirs: ["include"],
    defaults: ["VehicleHalDefaults"],
    static_libs: ["VehicleHalUtils"],
    header_libs: [
        "VehicleHalJsonConfigLoaderHeaders",
        "VehicleHalTestUtilHeaders",
    ],
    export_static_lib_headers: ["VehicleHalUtils"],
    export_header_lib_headers: [
        "VehicleHalTestUtilHeaders",
        "VehicleHalJsonConfigLoaderHeaders",
    ],
}
+0 −6
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ cc_test {
        "libgtest",
    ],
    header_libs: [
        // TODO(b/238685398): Remove this once we deprecate DefaultConfig.h
        "VehicleHalDefaultConfig",
        "IVehicleGeneratedHeaders",
    ],
    shared_libs: [
@@ -55,13 +53,9 @@ cc_test {
        "libgtest",
    ],
    cflags: [
        // TODO(b/238685398): Remove this once we deprecate DefaultConfig.h
        "-DENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING",
        "-DENABLE_VEHICLE_HAL_TEST_PROPERTIES",
    ],
    header_libs: [
        // TODO(b/238685398): Remove this once we deprecate DefaultConfig.h
        "VehicleHalDefaultConfig",
        "IVehicleGeneratedHeaders",
    ],
    shared_libs: [
+0 −21
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
 * limitations under the License.
 */

#include <DefaultConfig.h>
#include <JsonConfigLoader.h>
#include <VehicleUtils.h>
#include <android-base/file.h>
@@ -80,26 +79,6 @@ TEST(DefaultConfigTest, TestloadVendorClusterTestProperties) {
    ASSERT_TRUE(result.ok()) << result.error().message();
}

// TODO(b/238685398): Remove this test after we deprecate DefaultConfig.h
TEST(DefaultConfigTest, TestCompatibleWithDefaultConfigHeader) {
    auto configsFromHeaderFile = defaultconfig::getDefaultConfigs();

    std::vector<ConfigDeclaration> configsFromJson;
    JsonConfigLoader loader;
    for (const char* file :
         std::vector<const char*>({kDefaultPropertiesConfigFile, kTestPropertiesConfigFile,
                                   kVendorClusterTestPropertiesConfigFile})) {
        auto result = loadConfig(loader, file);
        ASSERT_TRUE(result.ok()) << result.error().message();
        for (auto& [propId, configDeclaration] : result.value()) {
            configsFromJson.push_back(configDeclaration);
        }
    }

    ASSERT_EQ(configsFromHeaderFile.size(), configsFromJson.size());
    ASSERT_THAT(configsFromHeaderFile, UnorderedElementsAreArray(configsFromJson));
}

#endif  // ENABLE_VEHICLE_HAL_TEST_PROPERTIES

}  // namespace test
+0 −1
Original line number Diff line number Diff line
@@ -61,6 +61,5 @@ cc_test {
    data: [
        ":VehicleHalDefaultProperties_JSON",
    ],
    header_libs: ["VehicleHalDefaultConfig"],
    test_suites: ["device-tests"],
}