diff options
| author | 2018-08-01 16:09:51 -0700 | |
|---|---|---|
| committer | 2018-08-01 16:09:51 -0700 | |
| commit | e784d5e5caa607bc96b686b3b55e138eb8da05a0 (patch) | |
| tree | 20e4b30695ac531f9b8eb69f826d96b022395d06 | |
| parent | 5d44cf6f724502acd7690d67acfa1123bb860e9a (diff) | |
| parent | 2cbf44dc2ff17f6866063d93465cc4688827121c (diff) | |
Merge "Telecom: Reset the duration after the CDMA call is accepted"
am: 2cbf44dc2f
Change-Id: I823efd5765b77fcf55f4c38a6091d980530abae8
6 files changed, 42 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index c96463cd1681..fa4b011b55d8 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -842,6 +842,7 @@ public abstract class Connection extends Conferenceable { public void onRemoteRttRequest(Connection c) {} /** @hide */ public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {} + public void onConnectionTimeReset(Connection c) {} } /** @@ -2366,6 +2367,16 @@ public abstract class Connection extends Conferenceable { } /** + * @hide + * Resets the cdma connection time. + */ + public final void resetConnectionTime() { + for (Listener l : mListeners) { + l.onConnectionTimeReset(this); + } + } + + /** * Returns the connections or conferences with which this connection can be conferenced. */ public final List<Conferenceable> getConferenceables() { diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index aa790f7e45e4..4c2d22fdc0de 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -1474,6 +1474,13 @@ public abstract class ConnectionService extends Service { mAdapter.onPhoneAccountChanged(id, pHandle); } } + + public void onConnectionTimeReset(Connection c) { + String id = mIdByConnection.get(c); + if (id != null) { + mAdapter.resetConnectionTime(id); + } + } }; /** {@inheritDoc} */ diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index 0d319bbc1d2a..520e7eda6f69 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -255,6 +255,18 @@ final class ConnectionServiceAdapter implements DeathRecipient { } /** + * Resets the cdma connection time. + */ + void resetConnectionTime(String callId) { + for (IConnectionServiceAdapter adapter : mAdapters) { + try { + adapter.resetConnectionTime(callId, Log.getExternalSession()); + } catch (RemoteException e) { + } + } + } + + /** * Indicates that the call no longer exists. Can be used with either a call or a conference * call. * diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index 3e1bf7790304..78d65e643abc 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -610,6 +610,11 @@ final class ConnectionServiceAdapterServant { public void onConnectionServiceFocusReleased(Session.Info sessionInfo) { mHandler.obtainMessage(MSG_CONNECTION_SERVICE_FOCUS_RELEASED).sendToTarget(); } + + @Override + public void resetConnectionTime(String callId, Session.Info sessionInfo) { + // Do nothing + } }; public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index bb4b483de326..9821dcbce85e 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -466,6 +466,11 @@ final class RemoteConnectionService { Log.w(this, "onRemoteRttRequest called on a remote conference"); } } + + @Override + public void resetConnectionTime(String callId, Session.Info sessionInfo) { + // Do nothing + } }; private final ConnectionServiceAdapterServant mServant = diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl index be474bd467ca..0157a5863363 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl @@ -121,4 +121,6 @@ oneway interface IConnectionServiceAdapter { in Session.Info sessionInfo); void onConnectionServiceFocusReleased(in Session.Info sessionInfo); + + void resetConnectionTime(String callIdi, in Session.Info sessionInfo); } |