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

Commit 88930e37 authored by Andrew Sapperstein's avatar Andrew Sapperstein
Browse files

Update eSIM deletion strings.

Adds some conditional behavior for the confirmation screens.
When the erase eSIM option is visible and checked, shows alternate string.

Fixes: 126262481
Fixes: 118751918
Test: visual inspection & make -j RunSettingsRoboTests
Change-Id: I40f983b03ad470d785bf104e645dbc92e7897d2d
parent b4ae464e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
    android:orientation="vertical">

    <TextView
        android:id="@+id/reset_network_confirm"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
+12 −6
Original line number Diff line number Diff line
@@ -3592,14 +3592,18 @@
    <string name="reset_network_title">Reset Wi-Fi, mobile &amp; Bluetooth</string>
    <!-- SD card & phone storage settings screen, message on screen after user selects Reset network settings [CHAR LIMIT=NONE] -->
    <string name="reset_network_desc">This will reset all network settings, including:\n\n<li>Wi\u2011Fi</li>\n<li>Mobile data</li>\n<li>Bluetooth</li>"</string>
    <!-- SD card & phone storage settings screen, title for the checkbox to let user decide whether erase eSIM data together [CHAR LIMIT=30] -->
    <string name="reset_esim_title">Erase eSIMs</string>
    <string name="reset_esim_title">Erase downloaded SIMs</string>
    <!-- SD card & phone storage settings screen, message for the checkbox to let user decide whether erase eSIM data together [CHAR LIMIT=NONE] -->
    <string name="reset_esim_desc">You\u2019ll have to contact your carrier to download replacement eSIMs. This won\u2019t cancel any mobile service plans.</string>
    <string name="reset_esim_desc">To download replacement SIMs, contact your carrier. This won\u2019t cancel any mobile service plans.</string>
    <!-- SD card & phone storage settings screen, button on screen after user selects Reset network settings -->
    <string name="reset_network_button_text">Reset settings</string>
    <!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button -->
    <string name="reset_network_final_desc">Reset all network settings? You can\u2019t undo this action!</string>
    <string name="reset_network_final_desc">Reset all network settings? You can\u2019t undo this action.</string>
    <!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button [CHAR LIMIT=NONE] -->
    <string name="reset_network_final_desc_esim">Reset all network settings and erase downloaded SIMs? You can\u2019t undo this action.</string>
    <!-- SD card & phone storage settings screen, button on screen after user selects Reset settings button -->
    <string name="reset_network_final_button_text">Reset settings</string>
    <!-- Reset settings confirmation screen title [CHAR LIMIT=30] -->
@@ -3609,9 +3613,9 @@
    <!-- Reset settings complete toast text [CHAR LIMIT=75] -->
    <string name="reset_network_complete_toast">Network settings have been reset</string>
    <!-- Title of the error message shown when error happens during erase eSIM data [CHAR LIMIT=NONE] -->
    <string name="reset_esim_error_title">Cant\u2019t reset eSIMs</string>
    <string name="reset_esim_error_title">Can\u2019t erase SIMs</string>
    <!-- Message of the error message shown when error happens during erase eSIM data [CHAR LIMIT=NONE] -->
    <string name="reset_esim_error_msg">The eSIMs can\u2019tt be reset due to an error.</string>
    <string name="reset_esim_error_msg">Downloaded SIMs can\u2019t be erased due to an error.\n\nRestart your device and try again.</string>
    <!-- Master Clear -->
    <!-- Button title to factory data reset the entire device -->
@@ -3649,7 +3653,9 @@
    <!-- SD card & phone storage settings screen, button on screen after user selects Factory data reset -->
    <string name="master_clear_button_text" product="default">Erase all data</string>
    <!-- SD card & phone storage settings screen, message on screen after user selects Reset phone button -->
    <string name="master_clear_final_desc">All of your personal information and downloaded apps will be deleted. You can\u2019t undo this action!</string>
    <string name="master_clear_final_desc">All of your personal information and downloaded apps will be deleted. You can\u2019t undo this action.</string>
    <!-- SD card & phone storage settings screen, message on screen after user selects Reset phone button [CHAR LIMIT=NONE] -->
    <string name="master_clear_final_desc_esim">All of your personal information, including downloaded apps &amp; SIMs, will be deleted. You can\u2019t undo this action.</string>
    <!-- SD card & phone storage settings screen, button on screen after user selects Reset phone button -->
    <string name="master_clear_final_button_text">Erase everything</string>
    <!-- Master clear failed message -->
+4 −2
Original line number Diff line number Diff line
@@ -102,7 +102,8 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
    private View mExternalStorageContainer;
    @VisibleForTesting
    CheckBox mExternalStorage;
    private View mEsimStorageContainer;
    @VisibleForTesting
    View mEsimStorageContainer;
    @VisibleForTesting
    CheckBox mEsimStorage;
    @VisibleForTesting
@@ -181,7 +182,8 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
    void showFinalConfirmation() {
        final Bundle args = new Bundle();
        args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
        args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked());
        args.putBoolean(ERASE_ESIMS_EXTRA,
            mEsimStorageContainer.getVisibility() == View.VISIBLE && mEsimStorage.isChecked());
        new SubSettingLauncher(getContext())
                .setDestination(MasterClearConfirm.class.getName())
                .setArguments(args)
+13 −2
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.VisibleForTesting;

import com.android.settings.core.InstrumentedFragment;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -62,9 +64,9 @@ import com.google.android.setupdesign.GlifLayout;
public class MasterClearConfirm extends InstrumentedFragment {
    private final static String TAG = "MasterClearConfirm";

    private View mContentView;
    @VisibleForTesting View mContentView;
    private boolean mEraseSdCard;
    private boolean mEraseEsims;
    @VisibleForTesting boolean mEraseEsims;

    /**
     * The user has gone through the multiple confirmation, so now we go ahead
@@ -199,6 +201,7 @@ public class MasterClearConfirm extends InstrumentedFragment {
        setUpActionBarAndTitle();
        establishFinalConfirmationState();
        setAccessibilityTitle();
        setSubtitle();
        return mContentView;
    }

@@ -212,6 +215,14 @@ public class MasterClearConfirm extends InstrumentedFragment {
        }
    }

    @VisibleForTesting
    void setSubtitle() {
        if (mEraseEsims) {
            ((TextView) mContentView.findViewById(R.id.master_clear_confirm))
                .setText(R.string.master_clear_final_desc_esim);
        }
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
+8 −4
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ import android.widget.CheckBox;
import android.widget.Spinner;
import android.widget.TextView;

import androidx.annotation.VisibleForTesting;

import com.android.internal.telephony.PhoneConstants;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.SubSettingLauncher;
@@ -74,8 +76,8 @@ public class ResetNetwork extends InstrumentedFragment {
    private View mContentView;
    private Spinner mSubscriptionSpinner;
    private Button mInitiateButton;
    private View mEsimContainer;
    private CheckBox mEsimCheckbox;
    @VisibleForTesting View mEsimContainer;
    @VisibleForTesting CheckBox mEsimCheckbox;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -112,14 +114,16 @@ public class ResetNetwork extends InstrumentedFragment {
        }
    }

    private void showFinalConfirmation() {
    @VisibleForTesting
    void showFinalConfirmation() {
        Bundle args = new Bundle();
        if (mSubscriptions != null && mSubscriptions.size() > 0) {
            int selectedIndex = mSubscriptionSpinner.getSelectedItemPosition();
            SubscriptionInfo subscription = mSubscriptions.get(selectedIndex);
            args.putInt(PhoneConstants.SUBSCRIPTION_KEY, subscription.getSubscriptionId());
        }
        args.putBoolean(MasterClear.ERASE_ESIMS_EXTRA, mEsimCheckbox.isChecked());
        args.putBoolean(MasterClear.ERASE_ESIMS_EXTRA,
            mEsimContainer.getVisibility() == View.VISIBLE && mEsimCheckbox.isChecked());
        new SubSettingLauncher(getContext())
                .setDestination(ResetNetworkConfirm.class.getName())
                .setArguments(args)
Loading