diff options
author | PauloftheWest <paulofthewest@google.com> | 2014-12-10 08:50:54 -0800 |
---|---|---|
committer | PauloftheWest <paulofthewest@google.com> | 2014-12-10 09:38:02 -0800 |
commit | f0d84e2e535a5f9f3454b7175e3212694bd691d8 (patch) | |
tree | 3fa12e2b98696e062a5d7e7768e29584d68da5e2 /src | |
parent | e0f637a66b9dbaaec80ef36c52a96fbb65735790 (diff) | |
download | packages_apps_Settings-f0d84e2e535a5f9f3454b7175e3212694bd691d8.zip packages_apps_Settings-f0d84e2e535a5f9f3454b7175e3212694bd691d8.tar.gz packages_apps_Settings-f0d84e2e535a5f9f3454b7175e3212694bd691d8.tar.bz2 |
Fixed a Data Usage crash
Bug: 18364933
Change-Id: I80657c6541aec0b4706ef4aa229c9f858776aab2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/DataUsageSummary.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java index 3296ba1..7e9e8ff 100644 --- a/src/com/android/settings/DataUsageSummary.java +++ b/src/com/android/settings/DataUsageSummary.java @@ -1176,21 +1176,29 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable }; private void handleMultiSimDataDialog() { - final SubscriptionInfo currentSir = getCurrentTabSubInfo(getActivity()); + final Context context = getActivity(); + final SubscriptionInfo currentSir = getCurrentTabSubInfo(context); final SubscriptionInfo nextSir = mSubscriptionManager.getActiveSubscriptionInfo( mSubscriptionManager.getDefaultDataSubId()); - if (currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) { + // If the device is single SIM or is enabling data on the active data SIM then forgo + // the pop-up. + if (!Utils.showSimCardTile(context) || + (nextSir != null && currentSir.getSubscriptionId() == nextSir.getSubscriptionId())) { setMobileDataEnabled(true); updateBody(); return; } + final String previousName = (nextSir == null) + ? context.getResources().getString(R.string.sim_selection_required_pref) + : nextSir.getDisplayName().toString(); + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.sim_change_data_title); builder.setMessage(getActivity().getResources().getString(R.string.sim_change_data_message, - currentSir.getDisplayName(), nextSir.getDisplayName())); + currentSir.getDisplayName(), previousName)); builder.setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() { @Override |