Loading src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java +5 −5 Original line number Diff line number Diff line Loading @@ -198,9 +198,11 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { .getGatewayInfoFromGatewayUri(mComponentName.getPackageName(), gatewayUri, mDestinationUri); mPhoneAccountHandle = targetPhoneAccount; // If carrier redirects call, we should skip to notify users about // the user-defined call redirection service. mUiAction = (confirmFirst && mServiceType.equals(SERVICE_TYPE_USER_DEFINED) && mAllowInteractiveResponse) ? UI_TYPE_USER_DEFINED_ASK_FOR_CONFIRM : mUiAction; ? UI_TYPE_USER_DEFINED_ASK_FOR_CONFIRM : UI_TYPE_NO_ACTION; Log.d(this, "Received redirectCall with [gatewayUri]" + Log.pii(gatewayUri) + " [phoneAccountHandle]" + mPhoneAccountHandle + "[confirmFirst]" + confirmFirst + " from " Loading Loading @@ -325,11 +327,9 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { * The entry to perform call redirection of the call from (@link CallsManager) */ public void performCallRedirection() { // If the Gateway Info is set with intent, do not request more call redirection. // If the Gateway Info is set with intent, only request with carrier call redirection. if (mRedirectionGatewayInfo != null) { mCallsManager.onCallRedirectionComplete(mCall, mDestinationUri, mPhoneAccountHandle, mRedirectionGatewayInfo, mSpeakerphoneOn, mVideoState, mShouldCancelCall, mUiAction); performCarrierCallRedirection(); } else { performUserDefinedCallRedirection(); } Loading tests/src/com/android/server/telecom/tests/CallRedirectionProcessorTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -269,8 +269,13 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { enableUserDefinedCallRedirectionService(); enableCarrierCallRedirectionService(); mProcessor.performCallRedirection(); verify(mContext, times(0)).bindServiceAsUser(any(Intent.class), verify(mContext, times(1)).bindServiceAsUser(any(Intent.class), any(ServiceConnection.class), anyInt(), any(UserHandle.class)); verify(mCallsManager, times(0)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); waitForHandlerActionDelayed(mProcessor.getHandler(), HANDLER_TIMEOUT_DELAY, CARRIER_SHORT_TIMEOUT_MS + CODE_EXECUTION_DELAY); verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), eq(mHandle), eq(mPhoneAccountHandle), eq(mGatewayInfo), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); Loading Loading
src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java +5 −5 Original line number Diff line number Diff line Loading @@ -198,9 +198,11 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { .getGatewayInfoFromGatewayUri(mComponentName.getPackageName(), gatewayUri, mDestinationUri); mPhoneAccountHandle = targetPhoneAccount; // If carrier redirects call, we should skip to notify users about // the user-defined call redirection service. mUiAction = (confirmFirst && mServiceType.equals(SERVICE_TYPE_USER_DEFINED) && mAllowInteractiveResponse) ? UI_TYPE_USER_DEFINED_ASK_FOR_CONFIRM : mUiAction; ? UI_TYPE_USER_DEFINED_ASK_FOR_CONFIRM : UI_TYPE_NO_ACTION; Log.d(this, "Received redirectCall with [gatewayUri]" + Log.pii(gatewayUri) + " [phoneAccountHandle]" + mPhoneAccountHandle + "[confirmFirst]" + confirmFirst + " from " Loading Loading @@ -325,11 +327,9 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { * The entry to perform call redirection of the call from (@link CallsManager) */ public void performCallRedirection() { // If the Gateway Info is set with intent, do not request more call redirection. // If the Gateway Info is set with intent, only request with carrier call redirection. if (mRedirectionGatewayInfo != null) { mCallsManager.onCallRedirectionComplete(mCall, mDestinationUri, mPhoneAccountHandle, mRedirectionGatewayInfo, mSpeakerphoneOn, mVideoState, mShouldCancelCall, mUiAction); performCarrierCallRedirection(); } else { performUserDefinedCallRedirection(); } Loading
tests/src/com/android/server/telecom/tests/CallRedirectionProcessorTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -269,8 +269,13 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { enableUserDefinedCallRedirectionService(); enableCarrierCallRedirectionService(); mProcessor.performCallRedirection(); verify(mContext, times(0)).bindServiceAsUser(any(Intent.class), verify(mContext, times(1)).bindServiceAsUser(any(Intent.class), any(ServiceConnection.class), anyInt(), any(UserHandle.class)); verify(mCallsManager, times(0)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); waitForHandlerActionDelayed(mProcessor.getHandler(), HANDLER_TIMEOUT_DELAY, CARRIER_SHORT_TIMEOUT_MS + CODE_EXECUTION_DELAY); verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), eq(mHandle), eq(mPhoneAccountHandle), eq(mGatewayInfo), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); Loading