diff options
Diffstat (limited to 'core/java/android/provider/CallLog.java')
-rw-r--r-- | core/java/android/provider/CallLog.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 0827fd6e725e..3d54ba10ef0c 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -35,6 +35,7 @@ import android.provider.ContactsContract.CommonDataKinds.Callable; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.ContactsContract.Data; import android.provider.ContactsContract.DataUsageFeedback; +import android.telecom.CallerInfo; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -42,7 +43,6 @@ import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.util.Log; -import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.PhoneConstants; import java.util.List; @@ -728,10 +728,11 @@ public class CallLog { String accountAddress = getLogAccountAddress(context, accountHandle); int numberPresentation = getLogNumberPresentation(number, presentation); + String name = (ci != null) ? ci.getName() : ""; if (numberPresentation != PRESENTATION_ALLOWED) { number = ""; if (ci != null) { - ci.name = ""; + name = ""; } } @@ -760,9 +761,7 @@ public class CallLog { values.put(PHONE_ACCOUNT_ID, accountId); values.put(PHONE_ACCOUNT_ADDRESS, accountAddress); values.put(NEW, Integer.valueOf(1)); - if ((ci != null) && (ci.name != null)) { - values.put(CACHED_NAME, ci.name); - } + values.put(CACHED_NAME, name); values.put(ADD_FOR_ALL_USERS, addForAllUsers ? 1 : 0); if (callType == MISSED_TYPE) { @@ -773,7 +772,7 @@ public class CallLog { values.put(CALL_SCREENING_APP_NAME, charSequenceToString(callScreeningAppName)); values.put(CALL_SCREENING_COMPONENT_NAME, callScreeningComponentName); - if ((ci != null) && (ci.contactIdOrZero > 0)) { + if ((ci != null) && (ci.getContactId() > 0)) { // Update usage information for the number associated with the contact ID. // We need to use both the number and the ID for obtaining a data ID since other // contacts may have the same number. @@ -787,17 +786,18 @@ public class CallLog { cursor = resolver.query(Phone.CONTENT_URI, new String[] { Phone._ID }, Phone.CONTACT_ID + " =? AND " + Phone.NORMALIZED_NUMBER + " =?", - new String[] { String.valueOf(ci.contactIdOrZero), + new String[] { String.valueOf(ci.getContactId()), normalizedPhoneNumber}, null); } else { - final String phoneNumber = ci.phoneNumber != null ? ci.phoneNumber : number; + final String phoneNumber = ci.getPhoneNumber() != null + ? ci.getPhoneNumber() : number; cursor = resolver.query( Uri.withAppendedPath(Callable.CONTENT_FILTER_URI, Uri.encode(phoneNumber)), new String[] { Phone._ID }, Phone.CONTACT_ID + " =?", - new String[] { String.valueOf(ci.contactIdOrZero) }, + new String[] { String.valueOf(ci.getContactId()) }, null); } |