Merge "Remove @hide method usage in Telecom."
diff --git a/src/com/android/server/telecom/CallLogManager.java b/src/com/android/server/telecom/CallLogManager.java
index d42c6b5..719277e 100755
--- a/src/com/android/server/telecom/CallLogManager.java
+++ b/src/com/android/server/telecom/CallLogManager.java
@@ -42,7 +42,6 @@
// 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;
@@ -239,8 +238,9 @@
// 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()) {
diff --git a/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java b/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
index c438c4a..0ada7ae 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestConnectionService.java
@@ -197,7 +197,9 @@
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));
diff --git a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
index b97f819..926d740 100644
--- a/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallExtrasTest.java
@@ -108,7 +108,10 @@
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));
@@ -130,7 +133,9 @@
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));
@@ -152,7 +157,9 @@
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(
@@ -176,8 +183,10 @@
// 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));
@@ -218,7 +227,9 @@
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));
diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
index b25b4c8..065c9b8 100644
--- a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
@@ -95,8 +95,6 @@
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;
@@ -1076,16 +1074,16 @@
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.
@@ -1096,8 +1094,9 @@
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() {