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

Commit d9746af1 authored by Yorke Lee's avatar Yorke Lee Committed by Android Git Automerger
Browse files

am 96421188: Default to mobile number type when adding unknown phone numbers

* commit '96421188':
  Default to mobile number type when adding unknown phone numbers
parents 3b417ba5 96421188
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -696,6 +696,14 @@ public class RawContactModifier {
                continue;
            } else if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
                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);