remove throwing ServiceSpecificException
remove throwing ServiceSpecificException code which is not required,
treat as fail silently, change throwing IllegalStateException
Bug: 262826254
Test: atest ImsServiceTest
Change-Id: I7687126437f7f01cbb84ebf57d188fa9c5dbf468
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index d6eb4aa..de51497 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -10194,8 +10194,9 @@
throw new IllegalArgumentException("Invalid Subscription ID: " + subId);
}
if (!isImsAvailableOnDevice()) {
- throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
- "IMS not available on device.");
+ // ProvisioningManager can not handle ServiceSpecificException.
+ // Throw the IllegalStateException and annotate ProvisioningManager.
+ throw new IllegalStateException("IMS not available on device.");
}
final long identity = Binder.clearCallingIdentity();
@@ -10794,8 +10795,9 @@
throw new IllegalArgumentException("Invalid Subscription ID: " + subId);
}
if (!isImsAvailableOnDevice()) {
- throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
- "IMS not available on device.");
+ // operation failed silently
+ Rlog.w(LOG_TAG, "IMS not available on device.");
+ return;
}
final long identity = Binder.clearCallingIdentity();
@@ -10819,8 +10821,9 @@
throw new IllegalArgumentException("Invalid Subscription ID: " + subId);
}
if (!isImsAvailableOnDevice()) {
- throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
- "IMS not available on device.");
+ // ProvisioningManager can not handle ServiceSpecificException.
+ // Throw the IllegalStateException and annotate ProvisioningManager.
+ throw new IllegalStateException("IMS not available on device.");
}
final long identity = Binder.clearCallingIdentity();