From 8eafb0724689728c83ca17e2e551a50500670037 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Sat, 16 Mar 2024 09:30:58 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!95=20:?= =?UTF-8?q?=20=E3=80=90=E5=AE=9A=E5=88=B6=E6=A1=86=E6=9E=B6=E3=80=91?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E7=BC=96=E8=AF=91=E4=BC=98=E5=8C=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle.json | 6 ++++++ config_policy.gni | 2 ++ frameworks/config_policy/BUILD.gn | 2 ++ frameworks/config_policy/src/config_policy_utils.c | 8 +++----- test/unittest/BUILD.gn | 7 +++++-- test/unittest/config_policy_utils_test.cpp | 4 +--- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/bundle.json b/bundle.json index f6e4c89..2eb63d4 100644 --- a/bundle.json +++ b/bundle.json @@ -45,6 +45,12 @@ "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"] } diff --git a/config_policy.gni b/config_policy.gni index c4a6a69..f334972 100644 --- a/config_policy.gni +++ b/config_policy.gni @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +TEL_CORESERVICE_ROOT_DIR = "//base/telephony/core_service" +STARTUP_INIT_ROOT_DIR = "//base/startup/init" declare_args() { # if fs has prefix before OH path, set it here config_policy_fs_prefix = "" diff --git a/frameworks/config_policy/BUILD.gn b/frameworks/config_policy/BUILD.gn index e167f3a..b818a15 100644 --- a/frameworks/config_policy/BUILD.gn +++ b/frameworks/config_policy/BUILD.gn @@ -43,6 +43,7 @@ if (defined(ohos_lite) && ohos_kernel_type == "liteos_m") { 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", @@ -63,6 +64,7 @@ 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", diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 9dcf4d7..8c10486 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -23,6 +23,7 @@ #include "config_policy_impl.h" #ifndef __LITEOS__ #include "init_param.h" +#include "telephony_config_c.h" #endif static const size_t MIN_APPEND_LEN = 32; @@ -36,10 +37,7 @@ static const unsigned int MIN_OPKEY_LEN = 3; // exampe:"etc/xml/config.xml,10:etc/xml/config1.xml,100,etc/carrier/${key:-value}" static const char SEP_FOR_X_RULE = ':'; static const char SEP_FOR_X_PARAM = ','; -static const char * const SEP_FOR_X_VALUE = ":-"; - -static const char * const CUST_OPKEY0 = "telephony.sim.opkey0"; -static const char * const CUST_OPKEY1 = "telephony.sim.opkey1"; +static const char *SEP_FOR_X_VALUE = ":-"; typedef struct { size_t size; // allocated buffer size of p @@ -116,7 +114,7 @@ static char *CustGetSystemParam(const char *name) static char *GetOpkeyPath(int type) { char *result = NULL; - const char * const opKeyDir = "etc/carrier/"; + const char *opKeyDir = "etc/carrier/"; const char *opKeyName = CUST_OPKEY0; if (type == FOLLOWX_MODE_SIM_1) { opKeyName = CUST_OPKEY0; diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 3dae7fb..b0e4c6a 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -20,14 +20,17 @@ if (defined(ohos_lite)) { } config_policy_sources = [ "config_policy_utils_test.cpp" ] -config_policy_include_dirs = [ "../../interfaces/inner_api/include" ] +config_policy_include_dirs = [ + "../../interfaces/inner_api/include", + "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", +] config_policy_deps = [ "../../frameworks/config_policy:configpolicy_util" ] if (defined(ohos_lite)) { unittest("ConfigPolicyUtilsTest") { output_extension = "bin" sources = config_policy_sources - include_dirs = config_policy_include_dirs + include_dirs = [ "../../interfaces/inner_api/include" ] 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 8c1878c..6128a94 100644 --- a/test/unittest/config_policy_utils_test.cpp +++ b/test/unittest/config_policy_utils_test.cpp @@ -21,9 +21,7 @@ #include "config_policy_impl.h" #ifndef __LITEOS__ #include "init_param.h" - -constexpr const char *CUST_OPKEY0 = "telephony.sim.opkey0"; -constexpr const char *CUST_OPKEY1 = "telephony.sim.opkey1"; +#include "telephony_config_c.h" #endif using namespace testing::ext; -- Gitee