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

Commit 26d51ed4 authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Fix NPE in getPhoneType/getEmailType

Change getPhoneType/getEmailType to return Integer instead of int. Rename
phoneHasType/emailHasType to hasPhoneType/hasEmailType and change to null
check return value of get methods.

Bug:24506801
Change-Id: If63ae76a93abcad646fc05b679d975c0d77b3f38
parent e4392ea8
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -545,11 +545,11 @@ public class ValuesDelta implements Parcelable {
        return getAsString(ContactsContract.CommonDataKinds.Phone.NORMALIZED_NUMBER);
    }

    public boolean phoneHasType() {
        return containsKey(ContactsContract.CommonDataKinds.Phone.TYPE);
    public boolean hasPhoneType() {
        return getPhoneType() != null;
    }

    public int getPhoneType() {
    public Integer getPhoneType() {
        return getAsInteger(ContactsContract.CommonDataKinds.Phone.TYPE);
    }

@@ -561,11 +561,11 @@ public class ValuesDelta implements Parcelable {
        return getAsString(ContactsContract.CommonDataKinds.Email.DATA);
    }

    public boolean emailHasType() {
        return containsKey(ContactsContract.CommonDataKinds.Email.TYPE);
    public boolean hasEmailType() {
        return getEmailType() != null;
    }

    public int getEmailType() {
    public Integer getEmailType() {
        return getAsInteger(ContactsContract.CommonDataKinds.Email.TYPE);
    }