Play tone when video upgrade request is received.
Added a VideoProviderProxy which intermediates between the VideoProvider
in the ConnectionService and the InCallService.
Changed CallsManager to listen for session modification requests via the
VideoProviderProxy and report these to its listeners via the
CallsManagerListeberBase.
Changed InCallToneMonitor to listen for session modification requests and
to play a tone when a request to upgrade is received.
Also, added an intent in the TestInCallService which I neglected to commit
in a previous CL.
Bug: 20232310
Change-Id: I1b105968f519ff6b166bbd02cb57b1cf68d2cea9
diff --git a/testapps/AndroidManifest.xml b/testapps/AndroidManifest.xml
index 8b9827f..df333a5 100644
--- a/testapps/AndroidManifest.xml
+++ b/testapps/AndroidManifest.xml
@@ -59,6 +59,7 @@
android:process="com.android.server.telecom.testapps.TestInCallService" >
<intent-filter>
<action android:name="android.server.telecom.testapps.ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE"/>
+ <action android:name="android.server.telecom.testapps.ACTION_SEND_UPGRADE_RESPONSE"/>
<data android:scheme="int" />
</intent-filter>
</receiver>
diff --git a/testapps/src/com/android/server/telecom/testapps/TestCallList.java b/testapps/src/com/android/server/telecom/testapps/TestCallList.java
index d6ed306..a16c4e2 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestCallList.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestCallList.java
@@ -144,6 +144,26 @@
}
}
+ /**
+ * For any video calls which are active, sends an upgrade to video response with the specified
+ * video state.
+ *
+ * @param videoState The video state to respond with.
+ */
+ public void sendUpgradeToVideoResponse(int videoState) {
+ Log.v(TAG, "sendUpgradeToVideoResponse : videoState = " + videoState);
+
+ for (Call call : mCalls) {
+ InCallService.VideoCall videoCall = call.getVideoCall();
+ if (videoCall == null) {
+ continue;
+ }
+
+ Log.v(TAG, "send upgrade to video response for call: " + call);
+ videoCall.sendSessionModifyResponse(new VideoProfile(videoState));
+ }
+ }
+
@Override
public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall) {
Log.v(TAG, "onVideoCallChanged: call = " + call + " " + System.identityHashCode(this));
diff --git a/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java b/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
index 790c9eb..b6902bf 100644
--- a/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
+++ b/testapps/src/com/android/server/telecom/testapps/TestInCallServiceBroadcastReceiver.java
@@ -34,6 +34,12 @@
"android.server.telecom.testapps.ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE";
/**
+ * Sends an a response to an upgrade to video request.
+ */
+ public static final String ACTION_SEND_UPGRADE_RESPONSE =
+ "android.server.telecom.testapps.ACTION_SEND_UPGRADE_RESPONSE";
+
+ /**
* Handles broadcasts directed at the {@link TestInCallServiceImpl}.
*
* @param context The Context in which the receiver is running.
@@ -47,6 +53,9 @@
if (ACTION_SEND_UPDATE_REQUEST_FROM_TEST_INCALL_SERVICE.equals(action)) {
final int videoState = Integer.parseInt(intent.getData().getSchemeSpecificPart());
TestCallList.getInstance().sendUpgradeToVideoRequest(videoState);
+ } else if (ACTION_SEND_UPGRADE_RESPONSE.equals(action)) {
+ final int videoState = Integer.parseInt(intent.getData().getSchemeSpecificPart());
+ TestCallList.getInstance().sendUpgradeToVideoResponse(videoState);
}
}
}