Removing CallServiceUnavailableException that is no longer applicable.
Also including some cleanup in preparation for the next round of switchboard changes.
Change-Id: Ia8b293c971ff3866e4317eca4c9d053779917956
diff --git a/src/com/android/telecomm/CallActivity.java b/src/com/android/telecomm/CallActivity.java
index f6785f5..7fbb22d 100644
--- a/src/com/android/telecomm/CallActivity.java
+++ b/src/com/android/telecomm/CallActivity.java
@@ -24,7 +24,6 @@
import android.util.Log;
import android.widget.Toast;
-import com.android.telecomm.exceptions.CallServiceUnavailableException;
import com.android.telecomm.exceptions.RestrictedCallException;
/**
@@ -103,10 +102,6 @@
mCallsManager.processOutgoingCallIntent(handle, contactInfo, context);
} catch (RestrictedCallException e) {
// TODO(gilad): Handle or explicitly state to be ignored.
- } catch (CallServiceUnavailableException e) {
- // TODO(gilad): Handle or explicitly state to be ignored. If both should be ignored,
- // consider extending from the same base class and simplify the handling code to a
- // single catch clause.
}
}
}
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index 29890b6..0712f03 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -18,7 +18,6 @@
import android.content.Context;
-import com.android.telecomm.exceptions.CallServiceUnavailableException;
import com.android.telecomm.exceptions.RestrictedCallException;
import com.google.common.collect.Lists;
@@ -53,16 +52,16 @@
private VoicemailManager mVoicemailManager;
- private List<OutgoingCallFilter> mOutgoingCallFilters = Lists.newArrayList();
+ private List<OutgoingCallValidator> mOutgoingCallValidators = Lists.newArrayList();
- private List<IncomingCallFilter> mIncomingCallFilters = Lists.newArrayList();
+ private List<IncomingCallValidator> mIncomingCallValidators = Lists.newArrayList();
static CallsManager getInstance() {
return INSTANCE;
}
/**
- * Private constructor initializes main components of telecomm.
+ * Initializes the required Telecomm components.
*/
private CallsManager() {
mSwitchboard = new Switchboard();
@@ -80,10 +79,10 @@
* @param context The application context.
*/
void processOutgoingCallIntent(String handle, ContactInfo contactInfo, Context context)
- throws RestrictedCallException, CallServiceUnavailableException {
+ throws RestrictedCallException {
- for (OutgoingCallFilter policy : mOutgoingCallFilters) {
- policy.validate(handle, contactInfo);
+ for (OutgoingCallValidator validator : mOutgoingCallValidators) {
+ validator.validate(handle, contactInfo);
}
// No objection to issue the call, proceed with trying to put it through.
diff --git a/src/com/android/telecomm/IncomingCallFilter.java b/src/com/android/telecomm/IncomingCallValidator.java
similarity index 75%
rename from src/com/android/telecomm/IncomingCallFilter.java
rename to src/com/android/telecomm/IncomingCallValidator.java
index 2d5e867..95ff477 100644
--- a/src/com/android/telecomm/IncomingCallFilter.java
+++ b/src/com/android/telecomm/IncomingCallValidator.java
@@ -2,5 +2,5 @@
// Can be used to reject incoming calls, see OutgoingCallFilter regarding
// outgoing calls.
-public interface IncomingCallFilter {
+public interface IncomingCallValidator {
}
diff --git a/src/com/android/telecomm/OutgoingCallFilter.java b/src/com/android/telecomm/OutgoingCallValidator.java
similarity index 93%
rename from src/com/android/telecomm/OutgoingCallFilter.java
rename to src/com/android/telecomm/OutgoingCallValidator.java
index 07b24f9..5e998c6 100644
--- a/src/com/android/telecomm/OutgoingCallFilter.java
+++ b/src/com/android/telecomm/OutgoingCallValidator.java
@@ -9,7 +9,7 @@
// invoked before a particular call service is selected.
// See http://en.wikipedia.org/wiki/Fixed_Dialing_Number and IncomingCallFilter
// regarding incoming calls.
-public interface OutgoingCallFilter {
+public interface OutgoingCallValidator {
public boolean validate(String userInput, ContactInfo contactInfo)
throws RestrictedCallException;
}
diff --git a/src/com/android/telecomm/Switchboard.java b/src/com/android/telecomm/Switchboard.java
index a1658e6..bb1ef3a 100644
--- a/src/com/android/telecomm/Switchboard.java
+++ b/src/com/android/telecomm/Switchboard.java
@@ -22,15 +22,9 @@
import com.google.common.collect.Sets;
import android.content.Context;
-import android.os.RemoteException;
import android.telecomm.ICallService;
import android.telecomm.ICallServiceSelector;
-import android.util.Log;
-import com.android.telecomm.exceptions.CallServiceUnavailableException;
-import com.android.telecomm.exceptions.OutgoingCallException;
-
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -46,8 +40,6 @@
*/
final class Switchboard {
- private static final String TAG = Switchboard.class.getSimpleName();
-
private CallServiceFinder mCallServiceFinder = new CallServiceFinder(this);
private CallServiceSelectorFinder mSelectorFinder = new CallServiceSelectorFinder(this);
@@ -72,10 +64,7 @@
private Map<Call, OutgoingCallProcessor> outgoingCallProcessors = Maps.newHashMap();
/**
- * Places an outgoing call to the handle passed in. Method asynchronously collects
- * {@link ICallService} implementations and passes them along with the handle and contactInfo
- * to {@link #placeOutgoingCallInternal} to actually place the call.
- * TODO(gilad): Update.
+ * Attempts to place an outgoing call to the specified handle.
*
* @param handle The handle to dial.
* @param contactInfo Information about the entity being called.
diff --git a/src/com/android/telecomm/exceptions/CallServiceUnavailableException.java b/src/com/android/telecomm/exceptions/CallServiceUnavailableException.java
deleted file mode 100644
index 960b47f..0000000
--- a/src/com/android/telecomm/exceptions/CallServiceUnavailableException.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.android.telecomm.exceptions;
-
-public class CallServiceUnavailableException extends Exception {
- public CallServiceUnavailableException() {
- super();
- }
-
- public CallServiceUnavailableException(String message) {
- super(message);
- }
-
- public CallServiceUnavailableException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public CallServiceUnavailableException(Throwable cause) {
- super(cause);
- }
-}