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

Commit f1c030e8 authored by Qiang Chen's avatar Qiang Chen
Browse files

Telecom: Reset the duration after the CDMA call is accepted

In android original design, the duration of CDMA MO call is started from
the dial command sent, so it is not the real duration of the active time.

In this patch, a new message is registered to listen the event of the call
accepted, and then reset the duration when the event happens.

Change-Id: Icc447012030ae243f200ec2c83b7d5210af9b31c
CRs-Fixed: 754497
parent 09d1135d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ public abstract class Connection implements IConferenceable {
        /** @hide */
        public void onConferenceParticipantsChanged(Connection c,
                List<ConferenceParticipant> participants) {}
        public void onCdmaConnectionTimeReset(Connection c) {}
    }

    /** @hide */
@@ -1028,6 +1029,15 @@ public abstract class Connection implements IConferenceable {
        fireOnConferenceableConnectionsChanged();
    }

    /**
     * Resets the cdma connection time.
     */
    public final void resetCdmaConnectionTime() {
        for (Listener l : mListeners) {
            l.onCdmaConnectionTimeReset(this);
        }
    }

    /**
     * Returns the connections or conferences with which this connection can be conferenced.
     */
+6 −0
Original line number Diff line number Diff line
@@ -621,6 +621,12 @@ public abstract class ConnectionService extends Service {
            Log.d(this, "Adapter set call substate %d", callSubstate);
            mAdapter.setCallSubstate(id, callSubstate);
        }

        @Override
        public void onCdmaConnectionTimeReset(Connection c) {
            String id = mIdByConnection.get(c);
            mAdapter.resetCdmaConnectionTime(id);
        }
    };

    /** {@inheritDoc} */
+12 −0
Original line number Diff line number Diff line
@@ -227,6 +227,18 @@ final class ConnectionServiceAdapter implements DeathRecipient {
        }
    }

    /**
     * Resets the cdma connection time.
     */
    void resetCdmaConnectionTime(String callId) {
        for (IConnectionServiceAdapter adapter : mAdapters) {
            try {
                adapter.resetCdmaConnectionTime(callId);
            } catch (RemoteException e) {
            }
        }
    }

    /**
     * Indicates that the call no longer exists. Can be used with either a call or a conference
     * call.
+4 −0
Original line number Diff line number Diff line
@@ -426,6 +426,10 @@ final class ConnectionServiceAdapterServant {
            args.arg2 = connection;
            mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget();
        }

        @Override
        public void resetCdmaConnectionTime(String callId) {
        }
    };

    public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
+4 −0
Original line number Diff line number Diff line
@@ -327,6 +327,10 @@ final class RemoteConnectionService {

            mOurConnectionServiceImpl.addRemoteExistingConnection(remoteConnction);
        }

        @Override
        public void resetCdmaConnectionTime(String callId) {
        }
    };

    private final ConnectionServiceAdapterServant mServant =
Loading