Merge "Clean up CellDataPreference dialog problems"
This commit is contained in:
@@ -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;
|
||||
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() {
|
||||
|
Reference in New Issue
Block a user