Merge "Show work missed call notification for sim call from work contacts"

This commit is contained in:
Victor Chang
2016-01-13 23:11:36 +00:00
committed by Android (Google) Code Review

View File

@@ -53,6 +53,9 @@ public class CallerInfo {
private static final String TAG = "CallerInfo";
private static final boolean VDBG = Rlog.isLoggable(TAG, Log.VERBOSE);
public static final long USER_TYPE_CURRENT = 0;
public static final long USER_TYPE_WORK = 1;
/**
* Please note that, any one of these member variables can be null,
* and any accesses to them should be prepared to handle such a case.
@@ -103,6 +106,8 @@ public class CallerInfo {
public Uri contactRefUri;
public String lookupKey;
public long userType;
/**
* Contact display photo URI. If a contact has no display photo but a thumbnail, it'll be
* the thumbnail URI instead.
@@ -154,6 +159,7 @@ public class CallerInfo {
// TODO: Move all the basic initialization here?
mIsEmergency = false;
mIsVoiceMail = false;
userType = USER_TYPE_CURRENT;
}
/**
@@ -173,6 +179,7 @@ public class CallerInfo {
info.cachedPhoto = null;
info.isCachedPhotoCurrent = false;
info.contactExists = false;
info.userType = USER_TYPE_CURRENT;
if (VDBG) Rlog.v(TAG, "getCallerInfo() based on cursor...");
@@ -225,6 +232,9 @@ public class CallerInfo {
Rlog.v(TAG, "==> got info.contactIdOrZero: " + info.contactIdOrZero);
}
}
if (Contacts.isEnterpriseContactId(contactId)) {
info.userType = USER_TYPE_WORK;
}
} else {
// No valid columnIndex, so we can't look up person_id.
Rlog.w(TAG, "Couldn't find contact_id column for " + contactRef);
@@ -628,6 +638,7 @@ public class CallerInfo {
/**
* @return a string debug representation of this instance.
*/
@Override
public String toString() {
// Warning: never check in this file with VERBOSE_DEBUG = true
// because that will result in PII in the system log.
@@ -658,6 +669,7 @@ public class CallerInfo {
.append("\nemergency: " + mIsEmergency)
.append("\nvoicemail " + mIsVoiceMail)
.append("\ncontactExists " + contactExists)
.append("\nuserType " + userType)
.append(" }")
.toString();
} else {