Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a85b690 authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

Settings: Carrier name in mobile plan doesn't translate into English

Operator name which get from framework method mismatch the location
language.

Change operator name to match location.

Change-Id: I2816fb8d8252dcc43dbed60fdb0824618e524898
CRs-Fixed: 789055
parent 5afad769
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ public class WirelessSettings extends SettingsPreferenceFragment
                    // Use NetworkOperatorName as second choice in case there is no
                    // SPN (Service Provider Name on the SIM). Such as with T-mobile.
                    operatorName = mTm.getNetworkOperatorName();
                    operatorName = getLocaleString(getActivity().getBaseContext(), operatorName);
                    if (TextUtils.isEmpty(operatorName)) {
                        mManageMobilePlanMessage = resources.getString(
                                R.string.mobile_unknown_sim_operator);
@@ -168,6 +169,7 @@ public class WirelessSettings extends SettingsPreferenceFragment
                                R.string.mobile_no_provisioning_url, operatorName);
                    }
                } else {
                    operatorName = getLocaleString(getActivity().getBaseContext(), operatorName);
                    mManageMobilePlanMessage = resources.getString(
                            R.string.mobile_no_provisioning_url, operatorName);
                }
@@ -185,6 +187,17 @@ public class WirelessSettings extends SettingsPreferenceFragment
        }
    }

    private String getLocaleString(Context context, String networkName) {
        log("networkName: " + networkName);
        if (networkName != null) {
            networkName = android.util.NativeTextHelper.getInternalLocalString(context,
                    networkName,
                    R.array.origin_carrier_names,
                    R.array.locale_carrier_names);
        }
        return networkName;
    }

    private void initSmsApplicationSetting() {
        log("initSmsApplicationSetting:");
        Collection<SmsApplicationData> smsApplications =