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

Commit 805321ff authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "Hide 'set default' checkbox if it's not going to be looked at next time...

Merge "Hide 'set default' checkbox if it's not going to be looked at next time anyway." into cm-10.2
parents f9c649e8 e5f12984
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> {
        private static final String ARG_PHONE_LIST = "phoneList";
        private static final String ARG_INTERACTION_TYPE = "interactionType";
        private static final String ARG_CALL_ORIGIN = "callOrigin";
        private static final String ARG_CAN_SAVE_PRIMARY = "canSavePrimary";

        private int mInteractionType;
        private ListAdapter mPhonesAdapter;
@@ -195,12 +196,13 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> {

        public static void show(FragmentManager fragmentManager,
                ArrayList<PhoneItem> phoneList, int interactionType,
                String callOrigin) {
                String callOrigin, boolean canSavePrimary) {
            PhoneDisambiguationDialogFragment fragment = new PhoneDisambiguationDialogFragment();
            Bundle bundle = new Bundle();
            bundle.putParcelableArrayList(ARG_PHONE_LIST, phoneList);
            bundle.putSerializable(ARG_INTERACTION_TYPE, interactionType);
            bundle.putString(ARG_CALL_ORIGIN, callOrigin);
            bundle.putBoolean(ARG_CAN_SAVE_PRIMARY, canSavePrimary);
            fragment.setArguments(bundle);
            fragment.show(fragmentManager, TAG);
        }
@@ -213,8 +215,13 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> {
            mCallOrigin = getArguments().getString(ARG_CALL_ORIGIN);

            mPhonesAdapter = new PhoneItemAdapter(activity, mPhoneList, mInteractionType);

            View setPrimaryView = null;
            if (getArguments().getBoolean(ARG_CAN_SAVE_PRIMARY)) {
                final LayoutInflater inflater = activity.getLayoutInflater();
            final View setPrimaryView = inflater.inflate(R.layout.set_primary_checkbox, null);
                setPrimaryView = inflater.inflate(R.layout.set_primary_checkbox, null);
            }

            return new AlertDialog.Builder(activity)
                    .setAdapter(mPhonesAdapter, this)
                    .setTitle(mInteractionType == ContactDisplayUtils.INTERACTION_SMS
@@ -231,7 +238,7 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> {
            if (mPhoneList.size() > which && which >= 0) {
                final PhoneItem phoneItem = mPhoneList.get(which);
                final CheckBox checkBox = (CheckBox)alertDialog.findViewById(R.id.setPrimary);
                if (checkBox.isChecked()) {
                if (checkBox != null && checkBox.isChecked()) {
                    // Request to mark the data as primary in the background.
                    final Intent serviceIntent = ContactUpdateService.createSetSuperPrimaryIntent(
                            activity, phoneItem.id);
@@ -500,6 +507,6 @@ public class PhoneNumberInteraction implements OnLoadCompleteListener<Cursor> {
    @VisibleForTesting
    /* package */ void showDisambiguationDialog(ArrayList<PhoneItem> phoneList) {
        PhoneDisambiguationDialogFragment.show(((Activity)mContext).getFragmentManager(),
                phoneList, mInteractionType, mCallOrigin);
                phoneList, mInteractionType, mCallOrigin, mUseDefault);
    }
}