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

Commit 43df90f8 authored by Yorke Lee's avatar Yorke Lee
Browse files

Don't log calls where disconnectCause == OUTGOING_CANCELED

Also fixed a bug where Google voice calls would be logged twice,
once for the canceled call and once for the call that actually happened.

Bug: 17142353
Change-Id: I1e5fe78b7d84005416e4d3a6732bd92a8ad4e5e6
parent cb59b679
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -708,9 +708,9 @@ final class Call implements CreateConnectionResponse {
    void abort() {
        if (mCreateConnectionProcessor != null) {
            mCreateConnectionProcessor.abort();
        } else if (mState == CallState.NEW || mState == CallState.PRE_DIAL_WAIT ||
                mState == CallState.CONNECTING) {
            handleCreateConnectionFailure(DisconnectCause.LOCAL, null);
        } else if (mState == CallState.NEW || mState == CallState.PRE_DIAL_WAIT
                || mState == CallState.CONNECTING) {
            handleCreateConnectionFailure(DisconnectCause.OUTGOING_CANCELED, null);
        } else {
            Log.v(this, "Cannot abort a call which isn't either PRE_DIAL_WAIT or CONNECTING");
        }
+4 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.provider.CallLog.Calls;
import android.telecomm.CallState;
import android.telecomm.PhoneAccountHandle;
import android.telecomm.VideoProfile;
import android.telephony.DisconnectCause;
import android.telephony.PhoneNumberUtils;

import com.android.internal.telephony.CallerInfo;
@@ -88,8 +89,9 @@ final class CallLogManager extends CallsManagerListenerBase {

    @Override
    public void onCallStateChanged(Call call, int oldState, int newState) {
        if ((newState == CallState.DISCONNECTED || newState == CallState.ABORTED) &&
                oldState != CallState.PRE_DIAL_WAIT) {
        if ((newState == CallState.DISCONNECTED || newState == CallState.ABORTED)
                && oldState != CallState.PRE_DIAL_WAIT
                && call.getDisconnectCause() != DisconnectCause.OUTGOING_CANCELED) {
            int type;
            if (!call.isIncoming()) {
                type = Calls.OUTGOING_TYPE;