summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brad Ebinger <breadley@google.com> 2020-05-27 18:10:51 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-05-27 18:10:51 +0000
commit0093603809a1d54d80deb5b0e10b9bbdae12d18d (patch)
treef1ab6c7b1af58b90e2c4485c256fecdf8126d284
parent792dc29a6eba3d21e8daa4644dd8694dcc829b96 (diff)
parentffb93e5dd69403a52cc733f102a54ef566855c2d (diff)
Merge "Remove IllegalArgumentException for registration of capabilities" into rvc-dev
-rw-r--r--telephony/java/android/telephony/ims/ImsMmTelManager.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/telephony/java/android/telephony/ims/ImsMmTelManager.java b/telephony/java/android/telephony/ims/ImsMmTelManager.java
index 43db1d9ce8a4..f6c14e67306b 100644
--- a/telephony/java/android/telephony/ims/ImsMmTelManager.java
+++ b/telephony/java/android/telephony/ims/ImsMmTelManager.java
@@ -518,9 +518,6 @@ public class ImsMmTelManager implements RegistrationManager {
* @param executor The executor the callback events should be run on.
* @param c The MmTel {@link CapabilityCallback} to be registered.
* @see #unregisterMmTelCapabilityCallback(CapabilityCallback)
- * @throws IllegalArgumentException if the subscription associated with this callback is not
- * active (SIM is not inserted, ESIM inactive) or invalid, or a null {@link Executor} or
- * {@link CapabilityCallback} callback.
* @throws ImsException if the subscription associated with this callback is valid, but
* the {@link ImsService} associated with the subscription is not available. This can happen if
* the service crashed, for example. See {@link ImsException#getCode()} for a more detailed
@@ -543,18 +540,13 @@ public class ImsMmTelManager implements RegistrationManager {
ITelephony iTelephony = getITelephony();
if (iTelephony == null) {
throw new ImsException("Could not find Telephony Service.",
- ImsException.CODE_ERROR_INVALID_SUBSCRIPTION);
+ ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
}
try {
iTelephony.registerMmTelCapabilityCallback(mSubId, c.getBinder());
} catch (ServiceSpecificException e) {
- if (e.errorCode == ImsException.CODE_ERROR_INVALID_SUBSCRIPTION) {
- // Rethrow as runtime error to keep API compatible.
- throw new IllegalArgumentException(e.getMessage());
- } else {
- throw new ImsException(e.getMessage(), e.errorCode);
- }
+ throw new ImsException(e.getMessage(), e.errorCode);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
} catch (IllegalStateException e) {