Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Clean up CellDataPreference dialog problems

Bug: 26830672
Change-Id: I189f8b2120143ca9829feebd24cf2ee93a33f05b
parent 99d92659
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
    }

+5 −4
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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() {