Merge "Properly catch ServiceSpecificException if IMS isn't available"

am: ba0576ee28

Change-Id: I929859652a436c507c6c2af73afad3ea9292b981
This commit is contained in:
Brad Ebinger
2020-01-17 12:44:47 -08:00
committed by android-build-merger

View File

@@ -29,6 +29,7 @@ import android.content.Context;
import android.os.Binder; import android.os.Binder;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.telephony.CarrierConfigManager; import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager;
import android.telephony.ims.aidl.IImsConfigCallback; import android.telephony.ims.aidl.IImsConfigCallback;
@@ -377,6 +378,8 @@ public class ProvisioningManager {
callback.setExecutor(executor); callback.setExecutor(executor);
try { try {
getITelephony().registerImsProvisioningChangedCallback(mSubId, callback.getBinder()); getITelephony().registerImsProvisioningChangedCallback(mSubId, callback.getBinder());
} catch (ServiceSpecificException e) {
throw new ImsException(e.getMessage(), e.errorCode);
} catch (RemoteException | IllegalStateException e) { } catch (RemoteException | IllegalStateException e) {
throw new ImsException(e.getMessage(), ImsException.CODE_ERROR_SERVICE_UNAVAILABLE); throw new ImsException(e.getMessage(), ImsException.CODE_ERROR_SERVICE_UNAVAILABLE);
} }