Update Telecomm to use new wrappers and aidl paths
Change-Id: If9e5cf619defd5347b145591a416004cf0072c95
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index c6b39b6..570b2ae 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -24,19 +24,19 @@
<!-- TODO(santoscordon): STOPSHIP Services in this manifest need permission protection. -->
<service android:name="com.android.telecomm.testcallservice.TestCallServiceProvider">
<intent-filter>
- <action android:name="android.telecomm.ICallServiceProvider" />
+ <action android:name="android.telecomm.CallServiceProvider" />
</intent-filter>
</service>
<service android:name="com.android.telecomm.testcallservice.TestCallService">
<intent-filter>
- <action android:name="android.telecomm.ICallService" />
+ <action android:name="android.telecomm.CallService" />
</intent-filter>
</service>
<service android:name="com.android.telecomm.testcallservice.DummyCallServiceSelector">
<intent-filter>
- <action android:name="android.telecomm.ICallServiceSelector" />
+ <action android:name="android.telecomm.CallServiceSelector" />
</intent-filter>
</service>
diff --git a/tests/src/com/android/telecomm/testcallservice/TestCallService.java b/tests/src/com/android/telecomm/testcallservice/TestCallService.java
index 8fa1303..db41055 100644
--- a/tests/src/com/android/telecomm/testcallservice/TestCallService.java
+++ b/tests/src/com/android/telecomm/testcallservice/TestCallService.java
@@ -16,6 +16,15 @@
package com.android.telecomm.testcallservice;
+import android.content.Intent;
+import android.media.MediaPlayer;
+import android.os.Bundle;
+import android.telecomm.CallInfo;
+import android.telecomm.CallService;
+import android.telecomm.CallServiceAdapter;
+import android.telecomm.CallState;
+import android.util.Log;
+
import com.android.telecomm.tests.R;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
@@ -23,16 +32,6 @@
import java.util.Set;
-import android.content.Intent;
-import android.media.MediaPlayer;
-import android.os.Bundle;
-import android.os.RemoteException;
-import android.telecomm.CallInfo;
-import android.telecomm.CallService;
-import android.telecomm.CallState;
-import android.telecomm.ICallServiceAdapter;
-import android.util.Log;
-
/**
* Service which provides fake calls to test the ICallService interface.
* TODO(santoscordon): Rename all classes in the directory to Dummy* (e.g., DummyCallService).
@@ -49,7 +48,7 @@
/**
* Adapter to call back into CallsManager.
*/
- private ICallServiceAdapter mCallsManagerAdapter;
+ private CallServiceAdapter mCallsManagerAdapter;
/**
* Used to play an audio tone during a call.
@@ -58,7 +57,7 @@
/** {@inheritDoc} */
@Override
- public void setCallServiceAdapter(ICallServiceAdapter callServiceAdapter) {
+ public void setCallServiceAdapter(CallServiceAdapter callServiceAdapter) {
Log.i(TAG, "setCallServiceAdapter()");
mCallsManagerAdapter = callServiceAdapter;
@@ -86,15 +85,11 @@
// Is compatible if the handle doesn't start with 7.
boolean isCompatible = !callInfo.getHandle().startsWith("7");
- try {
- // Tell CallsManager whether this call service can place the call (is compatible).
- // Returning positively on setCompatibleWith() doesn't guarantee that we will be chosen
- // to place the call. If we *are* chosen then CallsManager will execute the call()
- // method below.
- mCallsManagerAdapter.setCompatibleWith(callInfo.getId(), isCompatible);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to setCompatibleWith().", e);
- }
+ // Tell CallsManager whether this call service can place the call (is compatible).
+ // Returning positively on setCompatibleWith() doesn't guarantee that we will be chosen
+ // to place the call. If we *are* chosen then CallsManager will execute the call()
+ // method below.
+ mCallsManagerAdapter.setIsCompatibleWith(callInfo.getId(), isCompatible);
}
/**
@@ -109,11 +104,7 @@
createCall(callInfo.getId());
- try {
- mCallsManagerAdapter.handleSuccessfulOutgoingCall(callInfo.getId());
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to create a newOutgoingCall().", e);
- }
+ mCallsManagerAdapter.handleSuccessfulOutgoingCall(callInfo.getId());
}
/** {@inheritDoc} */
@@ -132,31 +123,19 @@
String handle = "5551234";
CallInfo callInfo = new CallInfo(callId, CallState.RINGING, handle);
- try {
- mCallsManagerAdapter.handleIncomingCall(callInfo);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to handleIncomingCall().", e);
- }
+ mCallsManagerAdapter.notifyIncomingCall(callInfo);
}
/** {@inheritDoc} */
@Override
public void answer(String callId) {
- try {
- mCallsManagerAdapter.setActive(callId);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to setActive the call " + callId);
- }
+ mCallsManagerAdapter.setActive(callId);
}
/** {@inheritDoc} */
@Override
public void reject(String callId) {
- try {
- mCallsManagerAdapter.setDisconnected(callId);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to setDisconnected the call " + callId);
- }
+ mCallsManagerAdapter.setDisconnected(callId);
}
/** {@inheritDoc} */
@@ -165,11 +144,7 @@
Log.i(TAG, "disconnect(" + callId + ")");
destroyCall(callId);
- try {
- mCallsManagerAdapter.setDisconnected(callId);
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to setDisconnected().", e);
- }
+ mCallsManagerAdapter.setDisconnected(callId);
}
/** {@inheritDoc} */
diff --git a/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java b/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java
index ddad90c..80c82db 100644
--- a/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java
+++ b/tests/src/com/android/telecomm/testcallservice/TestCallServiceProvider.java
@@ -18,10 +18,9 @@
import android.content.ComponentName;
import android.os.IBinder;
-import android.os.RemoteException;
import android.telecomm.CallServiceDescriptor;
+import android.telecomm.CallServiceLookupResponse;
import android.telecomm.CallServiceProvider;
-import android.telecomm.ICallServiceLookupResponse;
import android.util.Log;
import com.google.common.collect.Lists;
@@ -37,17 +36,13 @@
/** {@inheritDoc} */
@Override
- public void lookupCallServices(ICallServiceLookupResponse response) {
+ public void lookupCallServices(CallServiceLookupResponse response) {
Log.i(TAG, "lookupCallServices()");
- try {
- CallServiceDescriptor.Builder builder = CallServiceDescriptor.newBuilder(this);
- builder.setCallService(TestCallService.class);
- builder.setNetworkType(CallServiceDescriptor.FLAG_WIFI);
+ CallServiceDescriptor.Builder builder = CallServiceDescriptor.newBuilder(this);
+ builder.setCallService(TestCallService.class);
+ builder.setNetworkType(CallServiceDescriptor.FLAG_WIFI);
- response.setCallServiceDescriptors(Lists.newArrayList(builder.build()));
- } catch (RemoteException e) {
- Log.e(TAG, "Failed to setCallServices().", e);
- }
+ response.setCallServiceDescriptors(Lists.newArrayList(builder.build()));
}
}