Change warning message for roaming for DTAG.
Bug: 64106612
Test: manual
Change-Id: Ia94a4097330b6b1c4de7e94ddfa9685328241af5
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6e6f52e..2f883d8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -529,6 +529,8 @@
<string name="roaming_reenable_message">You\'ve lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">You may incur significant charges.</string>
+ <!-- Mobile network settings screen, message asking the user to check their pricing with their Carrier, when enabling Data roaming. -->
+ <string name="roaming_check_price_warning">Check with your network provider for pricing.</string>
<!-- Mobile network settings screen, dialog message title when user selects the Data roaming check box -->
<string name="roaming_alert_title">Allow data roaming?</string>
<!-- Mobile network settings screen, data usage setting check box name -->
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index b51e47d..fb7d71e 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -1268,6 +1268,7 @@
// First confirm with a warning dialog about charges
mOkClicked = false;
RoamingDialogFragment fragment = new RoamingDialogFragment();
+ fragment.setPhone(mPhone);
fragment.show(getFragmentManager(), ROAMING_TAG);
// Don't update the toggle unless the confirm button is actually pressed.
return false;
diff --git a/src/com/android/phone/RoamingDialogFragment.java b/src/com/android/phone/RoamingDialogFragment.java
index 21c6946..4d3bd47 100644
--- a/src/com/android/phone/RoamingDialogFragment.java
+++ b/src/com/android/phone/RoamingDialogFragment.java
@@ -24,6 +24,10 @@
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
+import android.os.PersistableBundle;
+import android.telephony.CarrierConfigManager;
+
+import com.android.internal.telephony.Phone;
/**
* A dialog fragment that asks the user if they are sure they want to turn on data roaming
@@ -41,6 +45,11 @@
// the host activity which implements the listening interface
private RoamingDialogListener mListener;
+ private Phone mPhone;
+
+ public void setPhone(Phone phone) {
+ mPhone = phone;
+ }
@Override
public void onAttach(Context context) {
@@ -59,8 +68,17 @@
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ int title = R.string.roaming_alert_title;
+ if (mPhone != null) {
+ PersistableBundle carrierConfig =
+ PhoneGlobals.getInstance().getCarrierConfigForSubId(mPhone.getSubId());
+ if (carrierConfig != null && carrierConfig.getBoolean(
+ CarrierConfigManager.KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL)) {
+ title = R.string.roaming_check_price_warning;
+ }
+ }
builder.setMessage(getResources().getString(R.string.roaming_warning))
- .setTitle(R.string.roaming_alert_title)
+ .setTitle(title)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, this);