Loading src/com/android/server/telecom/CallLogManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import android.telephony.SubscriptionManager; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.SubscriptionController; import com.android.server.telecom.callfiltering.CallFilteringResult; import java.util.Arrays; Loading Loading @@ -239,8 +238,9 @@ public final class CallLogManager extends CallsManagerListenerBase { // Explicitly canceled // Conference children connections only have CAPABILITY_DISCONNECT_FROM_CONFERENCE. // Log them when they are disconnected from conference. return Connection.can(call.getConnectionCapabilities(), Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE); return (call.getConnectionCapabilities() & Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE) == Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE; } // An external call if (call.isExternalCall()) { Loading testapps/src/com/android/server/telecom/testapps/TestConnectionService.java +3 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,9 @@ public class TestConnectionService extends ConnectionService { setConnectionProperties(properties); if (isIncoming) { putExtra(Connection.EXTRA_ANSWERING_DROPS_FG_CALL, true); Bundle newExtras = getExtras(); newExtras.putBoolean(Connection.EXTRA_ANSWERING_DROPS_FG_CALL, true); putExtras(newExtras); } LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver( mHangupReceiver, new IntentFilter(TestCallActivity.ACTION_HANGUP_CALLS)); Loading tests/src/com/android/server/telecom/tests/CallExtrasTest.java +17 −6 Original line number Diff line number Diff line Loading @@ -108,7 +108,10 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_BOOL, true); Bundle newExtras = new Bundle(); newExtras.putBoolean(EXTRA_KEY_BOOL, true); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue(mInCallServiceFixtureX.getCall(ids.mCallId).getExtras() .containsKey(EXTRA_KEY_BOOL)); Loading @@ -130,7 +133,9 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_INT, EXTRA_VALUE_INT); Bundle newExtras = new Bundle(); newExtras.putInt(EXTRA_KEY_INT, EXTRA_VALUE_INT); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_INT)); Loading @@ -152,7 +157,9 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE_STR); Bundle newExtras = new Bundle(); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( Loading @@ -176,8 +183,10 @@ public class CallExtrasTest extends TelecomSystemTest { // Add something. Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_STR2, EXTRA_VALUE_STR); connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE_STR); Bundle newExtras = new Bundle(); newExtras.putString(EXTRA_KEY_STR2, EXTRA_VALUE_STR); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_STR)); Loading Loading @@ -218,7 +227,9 @@ public class CallExtrasTest extends TelecomSystemTest { assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_INT)); connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE2_STR); Bundle newExtras = connection.getExtras(); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE2_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertEquals(EXTRA_VALUE2_STR, mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().getString(EXTRA_KEY_STR)); Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +7 −8 Original line number Diff line number Diff line Loading @@ -95,8 +95,6 @@ import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -1076,16 +1074,16 @@ public class CallsManagerTest extends TelecomTestCase { ongoingCall.setConnectionCapabilities( Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); newCapabilities = capabilitiesQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS); assertTrue(Connection.can(newCapabilities, Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertTrue((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); assertTrue(ongoingCall.isVideoCallingSupportedByPhoneAccount()); // Fire a changed event for the phone account making it not capable. mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar, SIM_2_ACCOUNT); newCapabilities = capabilitiesQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS); assertFalse(Connection.can(newCapabilities, Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertFalse((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); assertFalse(ongoingCall.isVideoCallingSupportedByPhoneAccount()); // Fire a change for an unrelated phone account. Loading @@ -1096,8 +1094,9 @@ public class CallsManagerTest extends TelecomTestCase { mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar, anotherVideoCapableAcct); // Call still should not be video capable assertFalse(Connection.can(ongoingCall.getConnectionCapabilities(), Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertFalse((ongoingCall.getConnectionCapabilities() & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); } private Call addSpyCall() { Loading Loading
src/com/android/server/telecom/CallLogManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import android.telephony.SubscriptionManager; // TODO: Needed for move to system service: import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CallerInfo; import com.android.internal.telephony.SubscriptionController; import com.android.server.telecom.callfiltering.CallFilteringResult; import java.util.Arrays; Loading Loading @@ -239,8 +238,9 @@ public final class CallLogManager extends CallsManagerListenerBase { // Explicitly canceled // Conference children connections only have CAPABILITY_DISCONNECT_FROM_CONFERENCE. // Log them when they are disconnected from conference. return Connection.can(call.getConnectionCapabilities(), Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE); return (call.getConnectionCapabilities() & Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE) == Connection.CAPABILITY_DISCONNECT_FROM_CONFERENCE; } // An external call if (call.isExternalCall()) { Loading
testapps/src/com/android/server/telecom/testapps/TestConnectionService.java +3 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,9 @@ public class TestConnectionService extends ConnectionService { setConnectionProperties(properties); if (isIncoming) { putExtra(Connection.EXTRA_ANSWERING_DROPS_FG_CALL, true); Bundle newExtras = getExtras(); newExtras.putBoolean(Connection.EXTRA_ANSWERING_DROPS_FG_CALL, true); putExtras(newExtras); } LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver( mHangupReceiver, new IntentFilter(TestCallActivity.ACTION_HANGUP_CALLS)); Loading
tests/src/com/android/server/telecom/tests/CallExtrasTest.java +17 −6 Original line number Diff line number Diff line Loading @@ -108,7 +108,10 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_BOOL, true); Bundle newExtras = new Bundle(); newExtras.putBoolean(EXTRA_KEY_BOOL, true); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue(mInCallServiceFixtureX.getCall(ids.mCallId).getExtras() .containsKey(EXTRA_KEY_BOOL)); Loading @@ -130,7 +133,9 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_INT, EXTRA_VALUE_INT); Bundle newExtras = new Bundle(); newExtras.putInt(EXTRA_KEY_INT, EXTRA_VALUE_INT); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_INT)); Loading @@ -152,7 +157,9 @@ public class CallExtrasTest extends TelecomSystemTest { mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE_STR); Bundle newExtras = new Bundle(); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( Loading @@ -176,8 +183,10 @@ public class CallExtrasTest extends TelecomSystemTest { // Add something. Connection connection = mConnectionServiceFixtureA.mLatestConnection; connection.putExtra(EXTRA_KEY_STR2, EXTRA_VALUE_STR); connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE_STR); Bundle newExtras = new Bundle(); newExtras.putString(EXTRA_KEY_STR2, EXTRA_VALUE_STR); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_STR)); Loading Loading @@ -218,7 +227,9 @@ public class CallExtrasTest extends TelecomSystemTest { assertTrue( mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().containsKey(EXTRA_KEY_INT)); connection.putExtra(EXTRA_KEY_STR, EXTRA_VALUE2_STR); Bundle newExtras = connection.getExtras(); newExtras.putString(EXTRA_KEY_STR, EXTRA_VALUE2_STR); connection.putExtras(newExtras); mInCallServiceFixtureX.waitForUpdate(); assertEquals(EXTRA_VALUE2_STR, mInCallServiceFixtureX.getCall(ids.mCallId).getExtras().getString(EXTRA_KEY_STR)); Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +7 −8 Original line number Diff line number Diff line Loading @@ -95,8 +95,6 @@ import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -1076,16 +1074,16 @@ public class CallsManagerTest extends TelecomTestCase { ongoingCall.setConnectionCapabilities( Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); newCapabilities = capabilitiesQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS); assertTrue(Connection.can(newCapabilities, Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertTrue((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); assertTrue(ongoingCall.isVideoCallingSupportedByPhoneAccount()); // Fire a changed event for the phone account making it not capable. mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar, SIM_2_ACCOUNT); newCapabilities = capabilitiesQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS); assertFalse(Connection.can(newCapabilities, Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertFalse((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); assertFalse(ongoingCall.isVideoCallingSupportedByPhoneAccount()); // Fire a change for an unrelated phone account. Loading @@ -1096,8 +1094,9 @@ public class CallsManagerTest extends TelecomTestCase { mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar, anotherVideoCapableAcct); // Call still should not be video capable assertFalse(Connection.can(ongoingCall.getConnectionCapabilities(), Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)); assertFalse((ongoingCall.getConnectionCapabilities() & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL) == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL); } private Call addSpyCall() { Loading