Merge "Throw new IllegalStateException in CallRedirectionService when the call redirection is not initialized yet" into sc-dev am: ba314fbb85
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15301694 Change-Id: I7e1205b9ba23266154abd0a51ed648daead73672
This commit is contained in:
@@ -100,6 +100,9 @@ public abstract class CallRedirectionService extends Service {
|
||||
*/
|
||||
public final void placeCallUnmodified() {
|
||||
try {
|
||||
if (mCallRedirectionAdapter == null) {
|
||||
throw new IllegalStateException("Can only be called from onPlaceCall.");
|
||||
}
|
||||
mCallRedirectionAdapter.placeCallUnmodified();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowAsRuntimeException();
|
||||
@@ -128,6 +131,9 @@ public abstract class CallRedirectionService extends Service {
|
||||
@NonNull PhoneAccountHandle targetPhoneAccount,
|
||||
boolean confirmFirst) {
|
||||
try {
|
||||
if (mCallRedirectionAdapter == null) {
|
||||
throw new IllegalStateException("Can only be called from onPlaceCall.");
|
||||
}
|
||||
mCallRedirectionAdapter.redirectCall(gatewayUri, targetPhoneAccount, confirmFirst);
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowAsRuntimeException();
|
||||
@@ -146,6 +152,9 @@ public abstract class CallRedirectionService extends Service {
|
||||
*/
|
||||
public final void cancelCall() {
|
||||
try {
|
||||
if (mCallRedirectionAdapter == null) {
|
||||
throw new IllegalStateException("Can only be called from onPlaceCall.");
|
||||
}
|
||||
mCallRedirectionAdapter.cancelCall();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowAsRuntimeException();
|
||||
|
||||
Reference in New Issue
Block a user