Loading telephony/java/com/android/internal/telephony/sip/SipPhone.java +28 −19 Original line number Diff line number Diff line Loading @@ -397,25 +397,45 @@ public class SipPhone extends SipPhoneBase { } } private CallerInfo getCallerInfo(String number) { private CallerInfo createCallerInfo(String number, SipProfile callee) { SipProfile p = callee; String name = p.getDisplayName(); if (TextUtils.isEmpty(name)) name = p.getUserName(); CallerInfo info = new CallerInfo(); info.name = name; info.phoneNumber = number; Log.v(LOG_TAG, "create caller info from scratch:"); Log.v(LOG_TAG, " name: " + info.name); Log.v(LOG_TAG, " numb: " + info.phoneNumber); return info; } // from contacts private CallerInfo findCallerInfo(String number) { CallerInfo info = CallerInfo.getCallerInfo(mContext, number); if ((info == null) || (info.name == null)) return null; Log.v(LOG_TAG, "++******++ got info from contact:"); Log.v(LOG_TAG, "got caller info from contact:"); Log.v(LOG_TAG, " name: " + info.name); Log.v(LOG_TAG, " numb: " + info.phoneNumber); Log.v(LOG_TAG, " pres: " + info.numberPresentation); return info; } Connection dial(String calleeSipUri) throws SipException { CallerInfo info = getCallerInfo(calleeSipUri); private CallerInfo getCallerInfo(String number, SipProfile callee) { CallerInfo info = findCallerInfo(number); if (info == null) info = createCallerInfo(number, callee); return info; } Connection dial(String originalNumber) throws SipException { String calleeSipUri = originalNumber; if (!calleeSipUri.contains("@")) { calleeSipUri += "@" + getSipDomain(mProfile); if (info != null) info.phoneNumber = calleeSipUri; } try { SipProfile callee = new SipProfile.Builder(calleeSipUri).build(); CallerInfo info = getCallerInfo(originalNumber, callee); SipConnection c = new SipConnection(this, callee, info); connections.add(c); c.dial(); Loading Loading @@ -447,9 +467,9 @@ public class SipPhone extends SipPhoneBase { void initIncomingCall(SipAudioCall sipAudioCall, boolean makeCallWait) { SipProfile callee = sipAudioCall.getPeerProfile(); CallerInfo info = getCallerInfo(getUriString(callee)); if (info == null) info = getCallerInfo(callee.getUserName()); if (info == null) info = getCallerInfo(callee.getDisplayName()); CallerInfo info = findCallerInfo(getUriString(callee)); if (info == null) info = findCallerInfo(callee.getUserName()); if (info == null) info = findCallerInfo(callee.getDisplayName()); SipConnection c = new SipConnection(this, callee, info); connections.add(c); Loading Loading @@ -657,20 +677,9 @@ public class SipPhone extends SipPhoneBase { super(getUriString(callee)); mOwner = owner; mPeer = callee; if (info == null) info = createCallerInfo(); setUserData(info); } private CallerInfo createCallerInfo() { SipProfile p = mPeer; String name = p.getDisplayName(); if (TextUtils.isEmpty(name)) name = p.getUserName(); CallerInfo info = new CallerInfo(); info.name = name; info.phoneNumber = getUriString(p); return info; } void initIncomingCall(SipAudioCall sipAudioCall, Call.State newState) { setState(newState); mSipAudioCall = sipAudioCall; Loading Loading
telephony/java/com/android/internal/telephony/sip/SipPhone.java +28 −19 Original line number Diff line number Diff line Loading @@ -397,25 +397,45 @@ public class SipPhone extends SipPhoneBase { } } private CallerInfo getCallerInfo(String number) { private CallerInfo createCallerInfo(String number, SipProfile callee) { SipProfile p = callee; String name = p.getDisplayName(); if (TextUtils.isEmpty(name)) name = p.getUserName(); CallerInfo info = new CallerInfo(); info.name = name; info.phoneNumber = number; Log.v(LOG_TAG, "create caller info from scratch:"); Log.v(LOG_TAG, " name: " + info.name); Log.v(LOG_TAG, " numb: " + info.phoneNumber); return info; } // from contacts private CallerInfo findCallerInfo(String number) { CallerInfo info = CallerInfo.getCallerInfo(mContext, number); if ((info == null) || (info.name == null)) return null; Log.v(LOG_TAG, "++******++ got info from contact:"); Log.v(LOG_TAG, "got caller info from contact:"); Log.v(LOG_TAG, " name: " + info.name); Log.v(LOG_TAG, " numb: " + info.phoneNumber); Log.v(LOG_TAG, " pres: " + info.numberPresentation); return info; } Connection dial(String calleeSipUri) throws SipException { CallerInfo info = getCallerInfo(calleeSipUri); private CallerInfo getCallerInfo(String number, SipProfile callee) { CallerInfo info = findCallerInfo(number); if (info == null) info = createCallerInfo(number, callee); return info; } Connection dial(String originalNumber) throws SipException { String calleeSipUri = originalNumber; if (!calleeSipUri.contains("@")) { calleeSipUri += "@" + getSipDomain(mProfile); if (info != null) info.phoneNumber = calleeSipUri; } try { SipProfile callee = new SipProfile.Builder(calleeSipUri).build(); CallerInfo info = getCallerInfo(originalNumber, callee); SipConnection c = new SipConnection(this, callee, info); connections.add(c); c.dial(); Loading Loading @@ -447,9 +467,9 @@ public class SipPhone extends SipPhoneBase { void initIncomingCall(SipAudioCall sipAudioCall, boolean makeCallWait) { SipProfile callee = sipAudioCall.getPeerProfile(); CallerInfo info = getCallerInfo(getUriString(callee)); if (info == null) info = getCallerInfo(callee.getUserName()); if (info == null) info = getCallerInfo(callee.getDisplayName()); CallerInfo info = findCallerInfo(getUriString(callee)); if (info == null) info = findCallerInfo(callee.getUserName()); if (info == null) info = findCallerInfo(callee.getDisplayName()); SipConnection c = new SipConnection(this, callee, info); connections.add(c); Loading Loading @@ -657,20 +677,9 @@ public class SipPhone extends SipPhoneBase { super(getUriString(callee)); mOwner = owner; mPeer = callee; if (info == null) info = createCallerInfo(); setUserData(info); } private CallerInfo createCallerInfo() { SipProfile p = mPeer; String name = p.getDisplayName(); if (TextUtils.isEmpty(name)) name = p.getUserName(); CallerInfo info = new CallerInfo(); info.name = name; info.phoneNumber = getUriString(p); return info; } void initIncomingCall(SipAudioCall sipAudioCall, Call.State newState) { setState(newState); mSipAudioCall = sipAudioCall; Loading