diff --git a/bundle.json b/bundle.json index 2eb63d47622edcd2fa9a3112594658ca99f1c72e..cf2c9933ec771c0651d7a5e771c6c9b379b32783 100644 --- a/bundle.json +++ b/bundle.json @@ -25,10 +25,11 @@ "hisysevent", "hilog", "napi", - "init", - "bounds_checking_function" + "init" ], - "third_party": [] + "third_party": [ + "bounds_checking_function" + ] }, "build": { "sub_component": [ @@ -43,16 +44,6 @@ ] }, "name": "//base/customization/config_policy/frameworks/config_policy:configpolicy_util" - }, - { - "header": { - "header_base": "//base/customization/config_policy/interfaces/inner_api/include", - "header_files": [ - "config_policy_utils.h" - ] - }, - "name": "//base/customization/config_policy/frameworks/config_policy:configpolicy_util_for_init_static", - "visibility": ["init"] } ], "test": [ diff --git a/frameworks/config_policy/BUILD.gn b/frameworks/config_policy/BUILD.gn index b818a1577a2dd9c54776b10a31d84dc05879bb2c..978cbc6e6ce811b21f0a4d19461399fbe228963c 100644 --- a/frameworks/config_policy/BUILD.gn +++ b/frameworks/config_policy/BUILD.gn @@ -20,7 +20,12 @@ if (defined(ohos_lite)) { config_policy_sources = [ "src/config_policy_utils.c" ] config("config_policy_config") { - include_dirs = [ "../../interfaces/inner_api/include" ] + include_dirs = [ + "../../interfaces/inner_api/include", + "//third_party/bounds_checking_function/include", + "$STARTUP_INIT_ROOT_DIR/interfaces/innerkits/include/param", + "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", + ] } if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") { @@ -30,25 +35,26 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") { print("cust config_policy_fs_prefix: ${config_policy_fs_prefix}") defines = [ "ROOT_PREFIX=\"${config_policy_fs_prefix}\"" ] } - public_configs = [ ":config_policy_config" ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + include_dirs = [ + "../../interfaces/inner_api/include", + "//third_party/bounds_checking_function/include", + ] } } else if (defined(ohos_lite)) { shared_library("configpolicy_util") { sources = config_policy_sources public_configs = [ ":config_policy_config" ] - external_deps = [ "bounds_checking_function:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } else { ohos_shared_library("configpolicy_util") { sources = config_policy_sources public_configs = [ ":config_policy_config" ] - include_dirs = [ "$TEL_CORESERVICE_ROOT_DIR/utils/common/include" ] - deps = [ "etc:customization_etc" ] - external_deps = [ - "bounds_checking_function:libsec_shared", - "init:libbegetutil", + deps = [ + "etc:customization_etc", + "//third_party/bounds_checking_function:libsec_shared", ] + external_deps = [ "init:libbegetutil" ] install_images = [ "system", "updater", @@ -64,11 +70,6 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") { ohos_static_library("configpolicy_util_for_init_static") { sources = config_policy_sources public_configs = [ ":config_policy_config" ] - include_dirs = [ "$TEL_CORESERVICE_ROOT_DIR/utils/common/include" ] - external_deps = [ - "bounds_checking_function:libsec_shared", - "init:export_headers_lib", - ] subsystem_name = "customization" part_name = "config_policy" } diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 46a8b6d266c38cd041619c8c39e05e00a4dbc660..6f14f82b0c805eba745c4f62005382d333382c4a 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -27,10 +27,8 @@ #endif static const size_t MIN_APPEND_LEN = 32; -#ifndef __LITEOS__ // set min opkey length static const unsigned int MIN_OPKEY_LEN = 3; -#endif // ':' split different x rules, example:":relPath,mode[,extra][:]" // ',' split different param for x rules // ":-" split for key:-value diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 01b1b766ed17a5b25899038a23b58e791e208f40..2ef63286431b4ec1d21bcd01faf8e7fcfcf17ee3 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -17,6 +17,7 @@ ohos_shared_library("configpolicy") { include_dirs = [ "include", "../../../interfaces/inner_api/include", + "//third_party/bounds_checking_function/include", "../../../frameworks/dfx/hisysevent_adapter", ] diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index b0e4c6a4e77f01254325502f3315f76548112372..10642eaffdaadc5da286516c8e0bd61ea8b8599e 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -22,6 +22,7 @@ if (defined(ohos_lite)) { config_policy_sources = [ "config_policy_utils_test.cpp" ] config_policy_include_dirs = [ "../../interfaces/inner_api/include", + "$STARTUP_INIT_ROOT_DIR/interfaces/innerkits/include/param", "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", ] config_policy_deps = [ "../../frameworks/config_policy:configpolicy_util" ] @@ -30,7 +31,7 @@ if (defined(ohos_lite)) { unittest("ConfigPolicyUtilsTest") { output_extension = "bin" sources = config_policy_sources - include_dirs = [ "../../interfaces/inner_api/include" ] + include_dirs = config_policy_include_dirs deps = config_policy_deps } group("unittest") { diff --git a/test/unittest/config_policy_utils_test.cpp b/test/unittest/config_policy_utils_test.cpp index 6128a94eb2bed6af0eb503ed70441f1706a0ea71..f38d113549847bbc9de20aef5cc263b84ee8e0d4 100644 --- a/test/unittest/config_policy_utils_test.cpp +++ b/test/unittest/config_policy_utils_test.cpp @@ -19,10 +19,8 @@ #include "config_policy_utils.h" #include "config_policy_impl.h" -#ifndef __LITEOS__ #include "init_param.h" #include "telephony_config_c.h" -#endif using namespace testing::ext; @@ -32,7 +30,6 @@ class ConfigPolicyUtilsTest : public testing::Test { static void SetUpTestCase(void); }; -#ifndef __LITEOS__ void ConfigPolicyUtilsTest::SetUpTestCase(void) { SystemSetParameter(CUST_OPKEY0, "46060"); @@ -40,7 +37,6 @@ void ConfigPolicyUtilsTest::SetUpTestCase(void) SystemSetParameter(CUST_FOLLOW_X_RULES, ":etc/custxmltest/user.xml,10:etc/custxmltest/both.xml,100,etc/carrier/${test:-46061}"); } -#endif bool TestGetCfgFile(const char *testPathSuffix, int type, const char *extra) { @@ -135,7 +131,6 @@ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest005, TestSize.Level1) EXPECT_TRUE(flag); } -#ifndef __LITEOS__ /** * @tc.name: CfgPolicyUtilsFuncTest006 * @tc.desc: Test GetOneCfgFile & GetCfgFiles function, follow default sim rule. @@ -199,5 +194,4 @@ HWTEST_F(ConfigPolicyUtilsTest, CfgPolicyUtilsFuncTest010, TestSize.Level1) EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/user.xml", FOLLOWX_MODE_USER_DEFINED, extraString.c_str())); EXPECT_TRUE(TestGetCfgFile("etc/custxmltest/both.xml", FOLLOWX_MODE_USER_DEFINED, extraString.c_str())); } -#endif // __LITEOS__ } // namespace OHOS diff --git a/test/unittest/config_policy_utils_test.h b/test/unittest/config_policy_utils_test.h index 3c886aaac494d5791f16f8771d58e1d2eec3894b..538dad507cddc96b9d24c6446c4e144ccfa30e2f 100644 --- a/test/unittest/config_policy_utils_test.h +++ b/test/unittest/config_policy_utils_test.h @@ -21,13 +21,10 @@ int CfgPolicyUtilsFuncTest002(void); int CfgPolicyUtilsFuncTest003(void); int CfgPolicyUtilsFuncTest004(void); int CfgPolicyUtilsFuncTest005(void); - -#ifndef __LITEOS__ int CfgPolicyUtilsFuncTest006(void); int CfgPolicyUtilsFuncTest007(void); int CfgPolicyUtilsFuncTest008(void); int CfgPolicyUtilsFuncTest009(void); int CfgPolicyUtilsFuncTest010(void); -#endif // __LITEOS__ #endif