提交 9b20f71a 编写于 作者: O openharmony_ci 提交者: Gitee

!57 change phone_manager to core_manager

Merge pull request !57 from c大神群里的小喽啰/OpenHarmony-3.0-LTS
...@@ -24,7 +24,7 @@ config("intl_config") { ...@@ -24,7 +24,7 @@ config("intl_config") {
ohos_shared_library("intl_util") { ohos_shared_library("intl_util") {
configs = [ configs = [
":intl_config", ":intl_config",
"//build/config/compiler:rtti" "//build/config/compiler:rtti",
] ]
include_dirs = [ include_dirs = [
"//third_party/icu/icu4c/source", "//third_party/icu/icu4c/source",
...@@ -33,48 +33,56 @@ ohos_shared_library("intl_util") { ...@@ -33,48 +33,56 @@ ohos_shared_library("intl_util") {
"//third_party/icu/icu4c/source/common/unicode", "//third_party/icu/icu4c/source/common/unicode",
"//base/global/i18n_standard/frameworks/intl/include", "//base/global/i18n_standard/frameworks/intl/include",
"//base/telephony/core_service/interfaces/innerkits/common", "//base/telephony/core_service/interfaces/innerkits/common",
"//base/telephony/core_service/interfaces/innerkits/network_search/include",
"//base/telephony/core_service/interfaces/innerkits/api",
"//base/telephony/core_service/interfaces/innerkits/proxy",
"//base/telephony/core_service/interfaces/innerkits/kits/js/napi/sim/include",
"//base/telephony/ril_adapter/interfaces/innerkits", "//base/telephony/ril_adapter/interfaces/innerkits",
"//base/telephony/core_service/common/log/include", "//base/telephony/core_service/common/log/include",
"//base/telephony/core_service/interfaces/kits/include",
"//utils/native/base/include", "//utils/native/base/include",
"//third_party/libxml2/include", "//third_party/libxml2/include",
] ]
sources = [ sources = [
"src/date_time_format.cpp", "src/date_time_format.cpp",
"src/locale_config.cpp",
"src/locale_info.cpp", "src/locale_info.cpp",
"src/number_format.cpp", "src/number_format.cpp",
"src/locale_config.cpp",
] ]
cflags_cc = [ cflags_cc = [
"-Wall", "-Wall",
"-fPIC", "-fPIC",
] ]
deps = [ deps = [
"//third_party/icu/icu4c:shared_icui18n", ":config_locales_xml",
"//third_party/icu/icu4c:shared_icuuc", ":config_regions_xml",
"//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
"//base/telephony/core_service:tel_core_service", "//base/telephony/core_service/interfaces/kits:tel_core_service_api",
"//utils/native/base:utils",
"//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
"//third_party/libxml2:xml2", "//third_party/libxml2:xml2",
":config_locales_xml", "//utils/native/base:utils",
":config_regions_xml"
] ]
external_deps = [ external_deps = [
"hiviewdfx_hilog_native:libhilog", "hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
] ]
subsystem_name = "global" subsystem_name = "global"
part_name = "i18n_standard" part_name = "i18n_standard"
} }
ohos_prebuilt_etc("config_locales_xml") { ohos_prebuilt_etc("config_locales_xml") {
source = "//base/global/i18n_standard/frameworks/intl/src/supported_locales.xml" source =
"//base/global/i18n_standard/frameworks/intl/src/supported_locales.xml"
module_install_dir = "usr/ohos_locale_config/" module_install_dir = "usr/ohos_locale_config/"
part_name = "i18n_standard" part_name = "i18n_standard"
subsystem_name = "global" subsystem_name = "global"
} }
ohos_prebuilt_etc("config_regions_xml") { ohos_prebuilt_etc("config_regions_xml") {
source = "//base/global/i18n_standard/frameworks/intl/src/supported_regions.xml" source =
"//base/global/i18n_standard/frameworks/intl/src/supported_regions.xml"
module_install_dir = "usr/ohos_locale_config/" module_install_dir = "usr/ohos_locale_config/"
part_name = "i18n_standard" part_name = "i18n_standard"
subsystem_name = "global" subsystem_name = "global"
......
...@@ -13,15 +13,17 @@ ...@@ -13,15 +13,17 @@
* limitations under the License. * limitations under the License.
*/ */
#include <algorithm> #include <algorithm>
#include <memory.h>
#include <unordered_set> #include <unordered_set>
#include "locale_config.h" #include "locale_config.h"
#include "core_manager.h"
#include "libxml/parser.h" #include "libxml/parser.h"
#include "locale_info.h" #include "locale_info.h"
#include "localebuilder.h" #include "localebuilder.h"
#include "locid.h" #include "locid.h"
#include "ohos/init_data.h" #include "ohos/init_data.h"
#include "parameter.h" #include "parameter.h"
#include "phone_manager.h" #include "sim_card_manager.h"
#include "string_ex.h" #include "string_ex.h"
#include "ucase.h" #include "ucase.h"
#include "unistr.h" #include "unistr.h"
...@@ -276,17 +278,9 @@ void LocaleConfig::GetRelatedLocales(unordered_set<string> &relatedLocales) ...@@ -276,17 +278,9 @@ void LocaleConfig::GetRelatedLocales(unordered_set<string> &relatedLocales)
void LocaleConfig::GetCountriesFromSim(vector<string> &simCountries) void LocaleConfig::GetCountriesFromSim(vector<string> &simCountries)
{ {
simCountries.push_back(GetSystemRegion()); simCountries.push_back(GetSystemRegion());
const PhoneManager& phoneManager = PhoneManager::GetInstance(); Telephony::SimCardManager simCardManager;
for (auto iter = phoneManager.phone_.begin(); iter != phoneManager.phone_.end(); ++iter) { simCardManager.ConnectService();
auto phone = iter->second; simCountries.push_back(Str16ToStr8(simCardManager.GetIsoCountryCodeForSim(0)));
if (phone == nullptr) {
continue;
}
auto sim = phone->simFileManager_;
if (sim != nullptr) {
simCountries.push_back(Str16ToStr8(sim->GetIsoCountryCode(0)));
}
}
} }
void LocaleConfig::GetListFromFile(const char *path, const char *resourceName, unordered_set<string> &ret) void LocaleConfig::GetListFromFile(const char *path, const char *resourceName, unordered_set<string> &ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册