Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +54 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.telecom.Log; import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.text.TextUtils; import com.android.ims.ImsException; import com.android.ims.ImsStreamMediaProfile; Loading Loading @@ -594,8 +595,10 @@ public class ImsPhoneConnection extends Connection { boolean updateParent = mParent.update(this, imsCall, state); boolean updateMediaCapabilities = updateMediaCapabilities(imsCall); boolean updateWifiState = updateWifiState(); boolean updateAddressDisplay = updateAddressDisplay(imsCall); return updateParent || updateMediaCapabilities || updateWifiState; return updateParent || updateMediaCapabilities || updateWifiState || updateAddressDisplay; } @Override Loading Loading @@ -641,6 +644,56 @@ public class ImsPhoneConnection extends Connection { return mConferenceConnectTime; } /** * Check for a change in the address display related fields for the {@link ImsCall}, and * update the {@link ImsPhoneConnection} with this information. * * @param imsCall The call to check for changes in address display fields. * @return Whether the address display fields have been changed. */ private boolean updateAddressDisplay(ImsCall imsCall) { if (imsCall == null) { return false; } boolean changed = false; ImsCallProfile callProfile = imsCall.getCallProfile(); if (callProfile != null) { String address = callProfile.getCallExtra(ImsCallProfile.EXTRA_OI); String name = callProfile.getCallExtra(ImsCallProfile.EXTRA_CNA); int nump = ImsCallProfile.OIRToPresentation( callProfile.getCallExtraInt(ImsCallProfile.EXTRA_OIR)); int namep = ImsCallProfile.OIRToPresentation( callProfile.getCallExtraInt(ImsCallProfile.EXTRA_CNAP)); if (Phone.DEBUG_PHONE) { Rlog.d(LOG_TAG, "address = " + address + " name = " + name + " nump = " + nump + " namep = " + namep); } if(equalsHandlesNulls(mAddress, address)) { mAddress = address; changed = true; } if (TextUtils.isEmpty(name)) { if (!TextUtils.isEmpty(mCnapName)) { mCnapName = ""; changed = true; } } else if (!name.equals(mCnapName)) { mCnapName = name; changed = true; } if (mNumberPresentation != nump) { mNumberPresentation = nump; changed = true; } if (mCnapNamePresentation != namep) { mCnapNamePresentation = namep; changed = true; } } return changed; } /** * Check for a change in the video capabilities and audio quality for the {@link ImsCall}, and * update the {@link ImsPhoneConnection} with this information. Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +54 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.telecom.Log; import android.telephony.DisconnectCause; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.text.TextUtils; import com.android.ims.ImsException; import com.android.ims.ImsStreamMediaProfile; Loading Loading @@ -594,8 +595,10 @@ public class ImsPhoneConnection extends Connection { boolean updateParent = mParent.update(this, imsCall, state); boolean updateMediaCapabilities = updateMediaCapabilities(imsCall); boolean updateWifiState = updateWifiState(); boolean updateAddressDisplay = updateAddressDisplay(imsCall); return updateParent || updateMediaCapabilities || updateWifiState; return updateParent || updateMediaCapabilities || updateWifiState || updateAddressDisplay; } @Override Loading Loading @@ -641,6 +644,56 @@ public class ImsPhoneConnection extends Connection { return mConferenceConnectTime; } /** * Check for a change in the address display related fields for the {@link ImsCall}, and * update the {@link ImsPhoneConnection} with this information. * * @param imsCall The call to check for changes in address display fields. * @return Whether the address display fields have been changed. */ private boolean updateAddressDisplay(ImsCall imsCall) { if (imsCall == null) { return false; } boolean changed = false; ImsCallProfile callProfile = imsCall.getCallProfile(); if (callProfile != null) { String address = callProfile.getCallExtra(ImsCallProfile.EXTRA_OI); String name = callProfile.getCallExtra(ImsCallProfile.EXTRA_CNA); int nump = ImsCallProfile.OIRToPresentation( callProfile.getCallExtraInt(ImsCallProfile.EXTRA_OIR)); int namep = ImsCallProfile.OIRToPresentation( callProfile.getCallExtraInt(ImsCallProfile.EXTRA_CNAP)); if (Phone.DEBUG_PHONE) { Rlog.d(LOG_TAG, "address = " + address + " name = " + name + " nump = " + nump + " namep = " + namep); } if(equalsHandlesNulls(mAddress, address)) { mAddress = address; changed = true; } if (TextUtils.isEmpty(name)) { if (!TextUtils.isEmpty(mCnapName)) { mCnapName = ""; changed = true; } } else if (!name.equals(mCnapName)) { mCnapName = name; changed = true; } if (mNumberPresentation != nump) { mNumberPresentation = nump; changed = true; } if (mCnapNamePresentation != namep) { mCnapNamePresentation = namep; changed = true; } } return changed; } /** * Check for a change in the video capabilities and audio quality for the {@link ImsCall}, and * update the {@link ImsPhoneConnection} with this information. Loading