Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0611217c authored by sqian's avatar sqian Committed by android-build-merger
Browse files

Carrier and User-defined call redirection interaction am: f65f0905

am: 48696d7f

Change-Id: I1d7cd0f7212a935f519e7cd0a271f2fc1915f7ef
parents b5a59584 48696d7f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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 "
@@ -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();
        }
+6 −1
Original line number Diff line number Diff line
@@ -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));