Commit 199f5cdb authored by Jason Monk's avatar Jason Monk Committed by The Android Automerger

Clean up CellDataPreference dialog problems

Bug: 26830672
Change-Id: I189f8b2120143ca9829feebd24cf2ee93a33f05b
parent 99d92659
......@@ -29,7 +29,8 @@ public class CustomDialogPreference extends DialogPreference {
private CustomPreferenceDialogFragment mFragment;
public CustomDialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
public CustomDialogPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
......
......@@ -48,7 +48,7 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
private static final String TAG = "CellDataPreference";
public int mSubId;
public int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
public boolean mChecked;
public boolean mMultiSimDialog;
private TelephonyManager mTelephonyManager;
......@@ -65,8 +65,10 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
mTelephonyManager = TelephonyManager.from(getContext());
mChecked = state.mChecked;
mMultiSimDialog = state.mMultiSimDialog;
mSubId = state.mSubId;
setKey(getKey() + mSubId);
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
mSubId = state.mSubId;
setKey(getKey() + mSubId);
}
notifyChanged();
}
......@@ -110,7 +112,6 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
@Override
protected void performClick(View view) {
super.performClick(view);
MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
if (mChecked) {
// disabling data; show confirmation dialog which eventually
......
......@@ -138,6 +138,7 @@ public class DataUsageSummary extends DataUsageBase implements Indexable {
TemplatePreferenceCategory category = (TemplatePreferenceCategory)
inflatePreferences(R.xml.data_usage_cellular);
category.setTemplate(getNetworkTemplate(subId), subId, services);
category.pushTemplates(services);
}
private void addWifiSection() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment