From fcc9440a52545b47f3f1d8455d4e5f996b52c6d7 Mon Sep 17 00:00:00 2001 From: Antony Sargent Date: Fri, 22 Mar 2019 16:30:30 -0700 Subject: [PATCH] String changes for some SIM switch confirmation dialogs These are changes for strings used in two scenarios: -When switching which SIM is used for mobile data. This is an update to some existing strings. -Enabling an eSIM when another one is already enabled (so the first one will need to be disabled). These are new strings. Bug: 129156640 Test: compile, plus manual (run a device in DSDS mode, go to details for SIM that isn't currently used for mobile data, and tap on mobile data switch) Change-Id: Ie9dfe23c466cb454bbad916ba83b833967a0da0e --- res/values/strings.xml | 37 ++++++++++++++++++- .../telephony/MobileDataDialogFragment.java | 16 +++++--- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index ceaedf94635..d6e52f7b7eb 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2951,9 +2951,21 @@ Choose the SIM you prefer for mobile data. - Change data SIM? + + Use %1$s for mobile data? + - Use %1$s instead of %2$s for mobile data? + + You\u0027re using %2$s for mobile data. + If you switch to %1$s, + %2$s will no longer be used for mobile + data. + + + + Use %1$s + Update preferred SIM card? @@ -10673,6 +10685,27 @@ disabling/enabling a SIM. The SIM is disabled in this state. [CHAR LIMIT=40] --> Off + + + Switch to %1$s? + + + + Only one downloaded SIM can be active at a time.\n\nSwitching to + %1$s won\u0027t cancel your + %2$s service. + + + + Switch to %1$s + + Erase SIM diff --git a/src/com/android/settings/network/telephony/MobileDataDialogFragment.java b/src/com/android/settings/network/telephony/MobileDataDialogFragment.java index 276d1fbe613..a6183e96a5b 100644 --- a/src/com/android/settings/network/telephony/MobileDataDialogFragment.java +++ b/src/com/android/settings/network/telephony/MobileDataDialogFragment.java @@ -93,14 +93,18 @@ public class MobileDataDialogFragment extends InstrumentedDialogFragment impleme R.string.sim_selection_required_pref) : nextSubInfo.getDisplayName().toString(); + final String newName = (currentSubInfo == null) + ? getContext().getResources().getString( + R.string.sim_selection_required_pref) + : currentSubInfo.getDisplayName().toString(); + return new AlertDialog.Builder(context) - .setTitle(R.string.sim_change_data_title) + .setTitle(context.getString(R.string.sim_change_data_title, newName)) .setMessage(context.getString(R.string.sim_change_data_message, - currentSubInfo != null - ? currentSubInfo.getDisplayName() - : "", - previousName)) - .setPositiveButton(android.R.string.ok, this) + newName, previousName)) + .setPositiveButton( + context.getString(R.string.sim_change_data_ok, newName), + this) .setNegativeButton(R.string.cancel, null) .create(); default: