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

Commit 5d24888b authored by Qiang Chen's avatar Qiang Chen
Browse files

SystemUI: Update SPN/PLMN strings on locale changes

  - refresh SPN/PLMN string when languages change
  - add config to refresh PLMN on locale changes

Change-Id: Iea8159c1fe63a6370134f4a34b412ac83f3ecc2a
CRs-fixed: 626580
parent d3cee177
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -216,4 +216,11 @@
    <string name="tasklist_memory_usage">"剩余/总内存: [<xliff:g id="NUMBER">%s</xliff:g>] / [<xliff:g id="NAME">%s</xliff:g>]"</string>
    <string name="message_keep_one_launcher">至少保留一个桌面主屏!</string>
    <!--end add TaskManager-->

    <!-- Carrier Name -->
    <string name="China_Mobile">中国移动</string>
    <string name="China_Unicom">中国联通</string>
    <string name="China_Telecom">中国电信</string>

    <string name="roamingTextSearching">"正在搜索服务"</string>
</resources>
+24 −0
Original line number Diff line number Diff line
@@ -1102,4 +1102,28 @@
    </string-array>
    <string-array name="signal_strength_umts_fully_roaming_sim3">
    </string-array>

    <string-array name="origin_carrier_names" translateable="false">
        <item>CHINA\u0020\u0020MOBILE</item>
        <item>CHN-UNICOM</item>
        <item>China Mobile</item>
        <item>China Unicom</item>
        <item>China Telecom</item>
        <item>中国移动</item>
        <item>中国联通</item>
        <item>中国电信</item>
        <item>Searching for Service</item>
    </string-array>

    <string-array name="locale_carrier_names" translatable="false">
        <item>China_Mobile</item>
        <item>China_Unicom</item>
        <item>China_Mobile</item>
        <item>China_Unicom</item>
        <item>China_Telecom</item>
        <item>China_Mobile</item>
        <item>China_Unicom</item>
        <item>China_Telecom</item>
        <item>roamingTextSearching</item>
    </string-array>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -132,5 +132,8 @@
    -->
    <integer name="status_bar_style">0</integer>
    <bool name="config_enableTaskManager">false</bool>

    <!-- monitor locale change -->
    <bool name="config_monitor_locale_change">false</bool>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -520,4 +520,11 @@
    <string name="tasklist_memory_usage">"Free/Total Memory:[<xliff:g id="number">%s</xliff:g>] / [<xliff:g id="name">%s</xliff:g>]"</string>
    <string name="message_keep_one_launcher">Should keep at lease one home activity!</string>
    <!--end TaskManager-->

    <!-- Carrier Name -->
    <string name="China_Mobile">China Mobile</string>
    <string name="China_Unicom">China Unicom</string>
    <string name="China_Telecom">China Telecom</string>

    <string name="roamingTextSearching">Searching for Service</string>
</resources>
+19 −1
Original line number Diff line number Diff line
@@ -317,7 +317,15 @@ public class MSimNetworkController extends NetworkController {
            updateConnectivity(intent);
            refreshViews(mDefaultSubscription);
        } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
            if (mContext.getResources().getBoolean(R.bool.config_monitor_locale_change)) {
                for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) {
                    updateNetworkName(mMSimNetworkName[i], i);
                    updateCarrierText(i);
                    refreshViews(i);
                }
            } else {
                refreshViews(mDefaultSubscription);
            }
        } else if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
            updateAirplaneMode();
            for (int i = 0; i < MSimTelephonyManager.getDefault().getPhoneCount(); i++) {
@@ -814,10 +822,20 @@ public class MSimNetworkController extends NetworkController {
        } else {
            mMSimNetworkName[subscription] = mNetworkNameDefault;
        }

        // parse the string to current language string in public resources
        if (mContext.getResources().getBoolean(R.bool.config_monitor_locale_change)) {
            updateNetworkName(mMSimNetworkName[subscription], subscription);
        }
        Slog.d(TAG, "mMSimNetworkName[subscription] " + mMSimNetworkName[subscription]
                                                      + "subscription " + subscription);
    }

    private void updateNetworkName(String networkName, int subscription) {
        updateNetworkName(networkName);
        mMSimNetworkName[subscription] = mNetworkName;
    }

    // ===== Full or limited Internet connectivity ==================================
    @Override
    protected void updateConnectivity(Intent intent) {
Loading