From be489e7afd1005aed52a041f52c17c38053df3e5 Mon Sep 17 00:00:00 2001 From: xiekaiming Date: Thu, 14 Mar 2024 15:29:07 +0800 Subject: [PATCH] =?UTF-8?q?wq=E5=8E=BB=E6=8E=89telephony=E7=9A=84=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiekaiming --- 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, 10 insertions(+), 19 deletions(-) diff --git a/bundle.json b/bundle.json index 2eb63d4..f6e4c89 100644 --- a/bundle.json +++ b/bundle.json @@ -45,12 +45,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"] } diff --git a/config_policy.gni b/config_policy.gni index f334972..c4a6a69 100644 --- a/config_policy.gni +++ b/config_policy.gni @@ -11,8 +11,6 @@ # 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 b818a15..e167f3a 100644 --- a/frameworks/config_policy/BUILD.gn +++ b/frameworks/config_policy/BUILD.gn @@ -43,7 +43,6 @@ 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", @@ -64,7 +63,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", diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 1693d3d..9b97ada 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -23,7 +23,6 @@ #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; @@ -37,7 +36,10 @@ 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 *SEP_FOR_X_VALUE = ":-"; +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"; typedef struct { size_t size; // allocated buffer size of p @@ -113,7 +115,7 @@ static char *CustGetSystemParam(const char *name) static char *GetOpkeyPath(int type) { char *result = NULL; - const char *opKeyDir = "etc/carrier/"; + const char * const 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 b0e4c6a..3dae7fb 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -20,17 +20,14 @@ if (defined(ohos_lite)) { } config_policy_sources = [ "config_policy_utils_test.cpp" ] -config_policy_include_dirs = [ - "../../interfaces/inner_api/include", - "$TEL_CORESERVICE_ROOT_DIR/utils/common/include", -] +config_policy_include_dirs = [ "../../interfaces/inner_api/include" ] config_policy_deps = [ "../../frameworks/config_policy:configpolicy_util" ] 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 6128a94..8c1878c 100644 --- a/test/unittest/config_policy_utils_test.cpp +++ b/test/unittest/config_policy_utils_test.cpp @@ -21,7 +21,9 @@ #include "config_policy_impl.h" #ifndef __LITEOS__ #include "init_param.h" -#include "telephony_config_c.h" + +constexpr const char *CUST_OPKEY0 = "telephony.sim.opkey0"; +constexpr const char *CUST_OPKEY1 = "telephony.sim.opkey1"; #endif using namespace testing::ext; -- Gitee