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

Commit 4386d926 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Fix issue that there is no indication to tell user the data sub changed...

Merge "Fix issue that there is no indication to tell user the data sub changed when disable one SIM slot."
parents 3f3a7a1f 271e1cf6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2643,6 +2643,7 @@
    <string name="sim_enabler_enabling">"启用中......"</string>
    <string name="sim_enabler_disabling">"禁用中......"</string>
    <string name="sub_activate_success">"启用成功。"</string>
    <string name="switch_data_subscription">即将切换到卡%1$s进行数据业务.</string>

    <string name="wifi_ap_list_category">"已连接设备"</string>
    <string name="ap_device_name_default">"匿名"</string>
+1 −1
Original line number Diff line number Diff line
@@ -6264,5 +6264,5 @@
    <string name="hotspot_settings_indication_step3_all">3. Select \u201c<xliff:g id="ssid_name">%s</xliff:g>\u201d and Enter \u201d<xliff:g id="ssid_pwd">%s</xliff:g>\u201d in the password field.</string>
    <string name="hotspot_settings_indication_step4">4. Start using the Internet on PC/Mobile device.</string>
    <string name="hotspot_turn_on_hint">To use WLAN hotspot, turn it on.</string>

    <string name="switch_data_subscription">Data services are now switched to SIM%1$s.</string>
</resources>
+13 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ import android.view.View;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import com.android.settings.MultiSimSettingTab;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
@@ -75,6 +77,8 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
    private static final String KEY_ACTIVITIES = "activities";
    private static final String KEY_PRIMARY_SUB_SELECT = "select_primary_sub";

    private long mPreferredDataSubscription;

    private static final int EVT_UPDATE = 1;
    private static int mNumSlots = 0;

@@ -113,6 +117,8 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable

        mNumSlots = tm.getSimCount();

        mPreferredDataSubscription = SubscriptionManager.getDefaultDataSubId();

        createPreferences();
        updateAllOptions();
        IntentFilter intentFilter =
@@ -147,6 +153,13 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
            Log.d(TAG, "Intent received: " + action);
            if (TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED.equals(action)) {
                updateCellularDataValues();
                long preferredDataSubscription = SubscriptionManager.getDefaultDataSubId();
                if (preferredDataSubscription != mPreferredDataSubscription) {
                    mPreferredDataSubscription = preferredDataSubscription;
                    String status = getResources().getString(R.string.switch_data_subscription,
                            SubscriptionManager.getSlotId(preferredDataSubscription) + 1);
                    Toast.makeText(getActivity(), status, Toast.LENGTH_SHORT).show();
                }
            } else if (TelephonyIntents.ACTION_SUBINFO_CONTENT_CHANGE.equals(action)
                    || TelephonyIntents.ACTION_SUBINFO_RECORD_UPDATED.equals(action)) {
                mAvailableSubInfos.clear();