提交 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") {
ohos_shared_library("intl_util") {
configs = [
":intl_config",
"//build/config/compiler:rtti"
"//build/config/compiler:rtti",
]
include_dirs = [
"//third_party/icu/icu4c/source",
......@@ -33,48 +33,56 @@ ohos_shared_library("intl_util") {
"//third_party/icu/icu4c/source/common/unicode",
"//base/global/i18n_standard/frameworks/intl/include",
"//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/core_service/common/log/include",
"//base/telephony/core_service/interfaces/kits/include",
"//utils/native/base/include",
"//third_party/libxml2/include",
]
sources = [
"src/date_time_format.cpp",
"src/locale_config.cpp",
"src/locale_info.cpp",
"src/number_format.cpp",
"src/locale_config.cpp",
]
cflags_cc = [
"-Wall",
"-fPIC",
]
deps = [
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
":config_locales_xml",
":config_regions_xml",
"//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
"//base/telephony/core_service:tel_core_service",
"//utils/native/base:utils",
"//base/telephony/core_service/interfaces/kits:tel_core_service_api",
"//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
"//third_party/icu/icu4c:shared_icui18n",
"//third_party/icu/icu4c:shared_icuuc",
"//third_party/libxml2:xml2",
":config_locales_xml",
":config_regions_xml"
"//utils/native/base:utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",
]
subsystem_name = "global"
part_name = "i18n_standard"
}
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/"
part_name = "i18n_standard"
subsystem_name = "global"
}
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/"
part_name = "i18n_standard"
subsystem_name = "global"
......
......@@ -13,15 +13,17 @@
* limitations under the License.
*/
#include <algorithm>
#include <memory.h>
#include <unordered_set>
#include "locale_config.h"
#include "core_manager.h"
#include "libxml/parser.h"
#include "locale_info.h"
#include "localebuilder.h"
#include "locid.h"
#include "ohos/init_data.h"
#include "parameter.h"
#include "phone_manager.h"
#include "sim_card_manager.h"
#include "string_ex.h"
#include "ucase.h"
#include "unistr.h"
......@@ -276,17 +278,9 @@ void LocaleConfig::GetRelatedLocales(unordered_set<string> &relatedLocales)
void LocaleConfig::GetCountriesFromSim(vector<string> &simCountries)
{
simCountries.push_back(GetSystemRegion());
const PhoneManager& phoneManager = PhoneManager::GetInstance();
for (auto iter = phoneManager.phone_.begin(); iter != phoneManager.phone_.end(); ++iter) {
auto phone = iter->second;
if (phone == nullptr) {
continue;
}
auto sim = phone->simFileManager_;
if (sim != nullptr) {
simCountries.push_back(Str16ToStr8(sim->GetIsoCountryCode(0)));
}
}
Telephony::SimCardManager simCardManager;
simCardManager.ConnectService();
simCountries.push_back(Str16ToStr8(simCardManager.GetIsoCountryCodeForSim(0)));
}
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.
先完成此消息的编辑!
想要评论请 注册