!1931 【轻量级 PR】:修复语言为英文时,手动搜网界面运营商名称仍显示中文问题

Merge pull request !1931 from 罗建贞/N/A
This commit is contained in:
openharmony_ci 2024-05-24 03:04:14 +00:00 committed by Gitee
commit f27b1476c5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -19,6 +19,7 @@
#include "telephony_errors.h"
#include "telephony_log_wrapper.h"
#include "telephony_ext_wrapper.h"
#include "operator_name_utils.h"
namespace OHOS {
namespace Telephony {
@ -186,9 +187,10 @@ bool NetworkSelection::AvailNetworkResult(
std::vector<NetworkInformation> networkInformation;
if (availableSize > 0) {
for (auto &availableNetworkInfoItem : availableNetworkInfo) {
std::string longName = availableNetworkInfoItem.longName;
std::string shortName = availableNetworkInfoItem.shortName;
std::string numeric = availableNetworkInfoItem.numeric;
std::string customName = OperatorNameUtils::GetInstance().GetCustomName(numeric);
std::string longName = customName.empty()? availableNetworkInfoItem.longName : customName;
std::string shortName = availableNetworkInfoItem.shortName;
int32_t status = availableNetworkInfoItem.status;
int32_t rat = availableNetworkInfoItem.rat;
NetworkInformation networkStateItem;