Merge "Catch ServiceSpecificExceptions properly when getting reg state/ transport type" into sc-dev am: 369f574bb0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15263378 Change-Id: I0e8d427bbddcd0a3abb793f6ef19846bc6b2e169
This commit is contained in:
@@ -37,6 +37,7 @@ import android.telephony.ims.aidl.IImsCapabilityCallback;
|
|||||||
import android.telephony.ims.feature.ImsFeature;
|
import android.telephony.ims.feature.ImsFeature;
|
||||||
import android.telephony.ims.feature.MmTelFeature;
|
import android.telephony.ims.feature.MmTelFeature;
|
||||||
import android.telephony.ims.stub.ImsRegistrationImplBase;
|
import android.telephony.ims.stub.ImsRegistrationImplBase;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.telephony.IIntegerConsumer;
|
import com.android.internal.telephony.IIntegerConsumer;
|
||||||
@@ -447,8 +448,9 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
executor.execute(() -> stateCallback.accept(result));
|
executor.execute(() -> stateCallback.accept(result));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RemoteException e) {
|
} catch (ServiceSpecificException | RemoteException e) {
|
||||||
throw e.rethrowAsRuntimeException();
|
Log.w("ImsMmTelManager", "Error getting registration state: " + e);
|
||||||
|
executor.execute(() -> stateCallback.accept(REGISTRATION_STATE_NOT_REGISTERED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,8 +490,10 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
executor.execute(() -> transportTypeCallback.accept(result));
|
executor.execute(() -> transportTypeCallback.accept(result));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RemoteException e) {
|
} catch (ServiceSpecificException | RemoteException e) {
|
||||||
throw e.rethrowAsRuntimeException();
|
Log.w("ImsMmTelManager", "Error getting transport type: " + e);
|
||||||
|
executor.execute(() -> transportTypeCallback.accept(
|
||||||
|
AccessNetworkConstants.TRANSPORT_TYPE_INVALID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -302,8 +302,10 @@ public class ImsRcsManager {
|
|||||||
executor.execute(() -> stateCallback.accept(result));
|
executor.execute(() -> stateCallback.accept(result));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RemoteException e) {
|
} catch (ServiceSpecificException | RemoteException e) {
|
||||||
throw e.rethrowAsRuntimeException();
|
Log.w(TAG, "Get registration state error: " + e);
|
||||||
|
executor.execute(() -> stateCallback.accept(
|
||||||
|
RegistrationManager.REGISTRATION_STATE_NOT_REGISTERED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,8 +348,10 @@ public class ImsRcsManager {
|
|||||||
executor.execute(() -> transportTypeCallback.accept(result));
|
executor.execute(() -> transportTypeCallback.accept(result));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RemoteException e) {
|
} catch (ServiceSpecificException | RemoteException e) {
|
||||||
throw e.rethrowAsRuntimeException();
|
Log.w(TAG, "Get registration transport type error: " + e);
|
||||||
|
executor.execute(() -> transportTypeCallback.accept(
|
||||||
|
AccessNetworkConstants.TRANSPORT_TYPE_INVALID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user