Merge "Clean up CellDataPreference dialog problems"
This commit is contained in:
@@ -29,7 +29,8 @@ public class CustomDialogPreference extends DialogPreference {
|
|||||||
|
|
||||||
private CustomPreferenceDialogFragment mFragment;
|
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);
|
super(context, attrs, defStyleAttr, defStyleRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
|
|||||||
|
|
||||||
private static final String TAG = "CellDataPreference";
|
private static final String TAG = "CellDataPreference";
|
||||||
|
|
||||||
public int mSubId;
|
public int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
public boolean mChecked;
|
public boolean mChecked;
|
||||||
public boolean mMultiSimDialog;
|
public boolean mMultiSimDialog;
|
||||||
private TelephonyManager mTelephonyManager;
|
private TelephonyManager mTelephonyManager;
|
||||||
@@ -65,8 +65,10 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
|
|||||||
mTelephonyManager = TelephonyManager.from(getContext());
|
mTelephonyManager = TelephonyManager.from(getContext());
|
||||||
mChecked = state.mChecked;
|
mChecked = state.mChecked;
|
||||||
mMultiSimDialog = state.mMultiSimDialog;
|
mMultiSimDialog = state.mMultiSimDialog;
|
||||||
|
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||||
mSubId = state.mSubId;
|
mSubId = state.mSubId;
|
||||||
setKey(getKey() + mSubId);
|
setKey(getKey() + mSubId);
|
||||||
|
}
|
||||||
notifyChanged();
|
notifyChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +112,6 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performClick(View view) {
|
protected void performClick(View view) {
|
||||||
super.performClick(view);
|
|
||||||
MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
|
MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
|
||||||
if (mChecked) {
|
if (mChecked) {
|
||||||
// disabling data; show confirmation dialog which eventually
|
// disabling data; show confirmation dialog which eventually
|
||||||
|
@@ -138,6 +138,7 @@ public class DataUsageSummary extends DataUsageBase implements Indexable {
|
|||||||
TemplatePreferenceCategory category = (TemplatePreferenceCategory)
|
TemplatePreferenceCategory category = (TemplatePreferenceCategory)
|
||||||
inflatePreferences(R.xml.data_usage_cellular);
|
inflatePreferences(R.xml.data_usage_cellular);
|
||||||
category.setTemplate(getNetworkTemplate(subId), subId, services);
|
category.setTemplate(getNetworkTemplate(subId), subId, services);
|
||||||
|
category.pushTemplates(services);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addWifiSection() {
|
private void addWifiSection() {
|
||||||
|
Reference in New Issue
Block a user