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

Commit a6809edd authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

Merge changes I8c12e8e6,I4878993a

am: dd6a7b31

Change-Id: I446bdde4bb2e035ee55aaaee6517ee15aced0822
parents d96dc972 dd6a7b31
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -161,8 +161,7 @@ public class NewOutgoingCallIntentBroadcaster {
                    }

                    GatewayInfo gatewayInfo = getGateWayInfoFromIntent(intent, resultHandleUri);
                    mCall.setNewOutgoingCallIntentBroadcastIsDone();
                    mCallsManager.placeOutgoingCall(mCall, resultHandleUri, gatewayInfo,
                    placeOutgoingCallImmediately(mCall, resultHandleUri, gatewayInfo,
                            mIntent.getBooleanExtra(
                                    TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false),
                            mIntent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE,
@@ -206,16 +205,10 @@ public class NewOutgoingCallIntentBroadcaster {
            if (Intent.ACTION_CALL.equals(action)
                    || Intent.ACTION_CALL_PRIVILEGED.equals(action)) {
                // Voicemail calls will be handled directly by the telephony connection manager
                Log.i(this, "Placing call immediately instead of waiting for "
                        + " OutgoingCallBroadcastReceiver: %s", intent);

                // Since we are not going to go through "Outgoing call broadcast", make sure
                // we mark it as ready.
                mCall.setNewOutgoingCallIntentBroadcastIsDone();

                boolean speakerphoneOn = mIntent.getBooleanExtra(
                        TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false);
                mCallsManager.placeOutgoingCall(mCall, handle, null, speakerphoneOn,
                placeOutgoingCallImmediately(mCall, handle, null, speakerphoneOn,
                        VideoProfile.STATE_AUDIO_ONLY);

                return DisconnectCause.NOT_DISCONNECTED;
@@ -270,15 +263,13 @@ public class NewOutgoingCallIntentBroadcaster {
        }

        if (callImmediately) {
            Log.i(this, "Placing call immediately instead of waiting for "
                    + " OutgoingCallBroadcastReceiver: %s", intent);
            String scheme = isUriNumber ? PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL;
            boolean speakerphoneOn = mIntent.getBooleanExtra(
                    TelecomManager.EXTRA_START_CALL_WITH_SPEAKERPHONE, false);
            int videoState = mIntent.getIntExtra(
                    TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE,
                    VideoProfile.STATE_AUDIO_ONLY);
            mCallsManager.placeOutgoingCall(mCall, Uri.fromParts(scheme, number, null), null,
            placeOutgoingCallImmediately(mCall, Uri.fromParts(scheme, number, null), null,
                    speakerphoneOn, videoState);

            // Don't return but instead continue and send the ACTION_NEW_OUTGOING_CALL broadcast
@@ -396,6 +387,16 @@ public class NewOutgoingCallIntentBroadcaster {
        return null;
    }

    private void placeOutgoingCallImmediately(Call call, Uri handle, GatewayInfo gatewayInfo,
            boolean speakerphoneOn, int videoState) {
        Log.i(this,
                "Placing call immediately instead of waiting for OutgoingCallBroadcastReceiver");
        // Since we are not going to go through "Outgoing call broadcast", make sure
        // we mark it as ready.
        mCall.setNewOutgoingCallIntentBroadcastIsDone();
        mCallsManager.placeOutgoingCall(call, handle, gatewayInfo, speakerphoneOn, videoState);
    }

    private void launchSystemDialer(Uri handle) {
        Intent systemDialerIntent = new Intent();
        final Resources resources = mContext.getResources();