diff --git a/bundle.json b/bundle.json index 2eb63d47622edcd2fa9a3112594658ca99f1c72e..f6e4c89a39c65751af6652eb4d142885a45ab119 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 f3349725110cf320f3979bed526e50e0d6dceb6b..c4a6a69d336d155a901fb1a697dc5d7c45ff9b3c 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 b818a1577a2dd9c54776b10a31d84dc05879bb2c..e167f3a5ef2c3546bce0b3f4219ffbd0c63f6a9d 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 1693d3d3843693e39c92b12ba3fc61c35edb3c70..9b97ada76c79c9d776fe8f026a52f567a0ca71cf 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 b0e4c6a4e77f01254325502f3315f76548112372..3dae7fb359ccbc71fb41a12b79cf3ebccdf5c44c 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 6128a94eb2bed6af0eb503ed70441f1706a0ea71..8c1878cf0ea7d3effd4da9dc02842215a9bee2d8 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;