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

Commit 3c040bf2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Telecom: Reset the duration after the CDMA call is accepted"

parents f3c74cef 6478e8a0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -990,6 +990,16 @@ public final class CallsManager extends Call.ListenerBase {
        }
    }

    void resetCdmaConnectionTime(Call call) {
        call.setConnectTimeMillis(System.currentTimeMillis());
        if (mCalls.contains(call)) {
            for (CallsManagerListener listener : mListeners) {
                listener.onCallStateChanged(call, CallState.ACTIVE, CallState.ACTIVE);
            }
            updateForegroundCall();
        }
    }

    /**
     * Cleans up any calls currently associated with the specified connection service when the
     * service binder disconnects unexpectedly.
+14 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
    private static final int MSG_SET_CALL_SUBSTATE = 24;
    private static final int MSG_ADD_EXISTING_CONNECTION = 25;
    private static final int MSG_SET_CALL_PROPERTIES = 26;
    private static final int MSG_RESET_CDMA_CONNECT_TIME = 27;

    private final Handler mHandler = new Handler() {
        @Override
@@ -409,6 +410,12 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
                        args.recycle();
                    }
                }
                case MSG_RESET_CDMA_CONNECT_TIME:
                    call = mCallIdMapper.getCall(msg.obj);
                    if (call != null) {
                        mCallsManager.resetCdmaConnectionTime(call);
                    }
                    break;
            }
        }
    };
@@ -664,6 +671,13 @@ final class ConnectionServiceWrapper extends ServiceBinder<IConnectionService> {
            args.arg2 = connection;
            mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget();
       }

       public void resetCdmaConnectionTime(String callId) {
            logIncoming("resetCdmaConnectionTime");
            if (mCallIdMapper.isValidCallId(callId) || mCallIdMapper.isValidConferenceId(callId)) {
                mHandler.obtainMessage(MSG_RESET_CDMA_CONNECT_TIME, callId).sendToTarget();
            }
        }
    }

    private final Adapter mAdapter = new Adapter();