Loading src/java/com/android/internal/telephony/Connection.java +9 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,15 @@ public abstract class Connection { return mIsIncoming; } /** * Sets whether this call is an incoming call or not. * @param isIncoming {@code true} if the call is an incoming call, {@code false} if it is an * outgoing call. */ public void setIsIncoming(boolean isIncoming) { mIsIncoming = isIncoming; } /** * If this Connection is connected, then it is associated with * a Call. Loading src/java/com/android/internal/telephony/GsmCdmaConnection.java +1 −2 Original line number Diff line number Diff line Loading @@ -614,8 +614,7 @@ public class GsmCdmaConnection extends Connection { //Ignore dc.number and dc.name in case of a handover connection if (isPhoneTypeGsm() && mOrigConnection != null) { if (Phone.DEBUG_PHONE) log("update: mOrigConnection is not null"); } else { log(" mNumberConverted " + mNumberConverted); } else if (isIncoming()) { if (!equalsBaseDialString(mAddress, dc.number) && (!mNumberConverted || !equalsBaseDialString(mConvertedNumber, dc.number))) { if (Phone.DEBUG_PHONE) log("update: phone # changed!"); Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +0 −9 Original line number Diff line number Diff line Loading @@ -236,15 +236,6 @@ public class ImsPhoneConnection extends Connection implements public void dispose() { } /** * Sets whether this call is an incoming call or not. * @param isIncoming {@code true} if the call is an incoming call, {@code false} if it is an * outgoing call. */ public void setIsIncoming(boolean isIncoming) { mIsIncoming = isIncoming; } static boolean equalsHandlesNulls (Object a, Object b) { return (a == null) ? (b == null) : a.equals (b); Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaConnectionTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -207,9 +207,23 @@ public class GsmCdmaConnectionTest extends TelephonyTest { mDC.state = DriverCall.State.ALERTING; for (String[] testAddress : testAddressMappingSet) { connection = new GsmCdmaConnection(mPhone, testAddress[0], mCT, null, false); connection.setIsIncoming(true); mDC.number = testAddress[1]; connection.update(mDC); assertEquals(testAddress[2], connection.getAddress()); } } /** * Ensures outgoing calls do not apply address changes. */ @Test @SmallTest public void testAddressUpdateOutgoing() { mDC.state = DriverCall.State.ALERTING; connection = new GsmCdmaConnection(mPhone, "12345", mCT, null, false); connection.setIsIncoming(false); mDC.number = "678"; connection.update(mDC); assertEquals("12345", connection.getAddress()); } } Loading
src/java/com/android/internal/telephony/Connection.java +9 −0 Original line number Diff line number Diff line Loading @@ -387,6 +387,15 @@ public abstract class Connection { return mIsIncoming; } /** * Sets whether this call is an incoming call or not. * @param isIncoming {@code true} if the call is an incoming call, {@code false} if it is an * outgoing call. */ public void setIsIncoming(boolean isIncoming) { mIsIncoming = isIncoming; } /** * If this Connection is connected, then it is associated with * a Call. Loading
src/java/com/android/internal/telephony/GsmCdmaConnection.java +1 −2 Original line number Diff line number Diff line Loading @@ -614,8 +614,7 @@ public class GsmCdmaConnection extends Connection { //Ignore dc.number and dc.name in case of a handover connection if (isPhoneTypeGsm() && mOrigConnection != null) { if (Phone.DEBUG_PHONE) log("update: mOrigConnection is not null"); } else { log(" mNumberConverted " + mNumberConverted); } else if (isIncoming()) { if (!equalsBaseDialString(mAddress, dc.number) && (!mNumberConverted || !equalsBaseDialString(mConvertedNumber, dc.number))) { if (Phone.DEBUG_PHONE) log("update: phone # changed!"); Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +0 −9 Original line number Diff line number Diff line Loading @@ -236,15 +236,6 @@ public class ImsPhoneConnection extends Connection implements public void dispose() { } /** * Sets whether this call is an incoming call or not. * @param isIncoming {@code true} if the call is an incoming call, {@code false} if it is an * outgoing call. */ public void setIsIncoming(boolean isIncoming) { mIsIncoming = isIncoming; } static boolean equalsHandlesNulls (Object a, Object b) { return (a == null) ? (b == null) : a.equals (b); Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaConnectionTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -207,9 +207,23 @@ public class GsmCdmaConnectionTest extends TelephonyTest { mDC.state = DriverCall.State.ALERTING; for (String[] testAddress : testAddressMappingSet) { connection = new GsmCdmaConnection(mPhone, testAddress[0], mCT, null, false); connection.setIsIncoming(true); mDC.number = testAddress[1]; connection.update(mDC); assertEquals(testAddress[2], connection.getAddress()); } } /** * Ensures outgoing calls do not apply address changes. */ @Test @SmallTest public void testAddressUpdateOutgoing() { mDC.state = DriverCall.State.ALERTING; connection = new GsmCdmaConnection(mPhone, "12345", mCT, null, false); connection.setIsIncoming(false); mDC.number = "678"; connection.update(mDC); assertEquals("12345", connection.getAddress()); } }