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

Commit 96421188 authored by Yorke Lee's avatar Yorke Lee
Browse files

Default to mobile number type when adding unknown phone numbers

Bug: 10693314
Change-Id: I368adeba114d2d2543bcf4c66324950c6b3edd79
parent 6cb6f6f8
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -696,6 +696,14 @@ public class RawContactModifier {
                continue;
                continue;
            } else if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
            } else if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
                values.remove(PhoneDataItem.KEY_FORMATTED_PHONE_NUMBER);
                values.remove(PhoneDataItem.KEY_FORMATTED_PHONE_NUMBER);
                final Integer type = values.getAsInteger(Phone.TYPE);
                // If the provided phone number provides a custom phone type but not a label,
                // replace it with mobile (by default) to avoid the "Enter custom label" from
                // popping up immediately upon entering the ContactEditorFragment
                if (type != null && type == Phone.TYPE_CUSTOM &&
                        TextUtils.isEmpty(values.getAsString(Phone.LABEL))) {
                    values.put(Phone.TYPE, Phone.TYPE_MOBILE);
                }
            }
            }


            DataKind kind = accountType.getKindForMimetype(mimeType);
            DataKind kind = accountType.getKindForMimetype(mimeType);