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

Commit b5354f56 authored by Radhika Agrawal's avatar Radhika Agrawal Committed by Android (Google) Code Review
Browse files

Merge "Report missed incoming calls which are auto rejected by the modem"

parents 785a0f72 61ad64cc
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -1241,6 +1241,11 @@ public class CallsManager extends Call.ListenerBase
        // TODO: Move this to be a part of addCall()
        call.addListener(this);

        if (extras.containsKey(TelecomManager.EXTRA_CALL_DISCONNECT_MESSAGE)) {
          String disconnectMessage = extras.getString(TelecomManager.EXTRA_CALL_DISCONNECT_MESSAGE);
          Log.i(this, "processIncomingCallIntent Disconnect message " + disconnectMessage);
        }

        boolean isHandoverAllowed = true;
        if (isHandover) {
            if (!isHandoverInProgress() &&
@@ -2722,6 +2727,7 @@ public class CallsManager extends Call.ListenerBase
     * @param disconnectCause The disconnect cause, see {@link android.telecom.DisconnectCause}.
     */
    void markCallAsDisconnected(Call call, DisconnectCause disconnectCause) {
      int oldState = call.getState();
      if (call.getState() == CallState.SIMULATED_RINGING
                && disconnectCause.getCode() == DisconnectCause.REMOTE) {
            // If the remote end hangs up while in SIMULATED_RINGING, the call should
@@ -2730,6 +2736,12 @@ public class CallsManager extends Call.ListenerBase
        }
        call.setDisconnectCause(disconnectCause);
        setCallState(call, CallState.DISCONNECTED, "disconnected set explicitly");

        if(oldState == CallState.NEW && disconnectCause.getCode() == DisconnectCause.MISSED) {
            Log.i(this, "markCallAsDisconnected: logging missed call ");
            mCallLogManager.logCall(call, Calls.MISSED_TYPE, true, null);
        }

    }

    /**