diff options
| author | 2018-08-01 17:34:56 -0700 | |
|---|---|---|
| committer | 2018-08-01 17:34:56 -0700 | |
| commit | 47dceea7d85fce9636f5cdf1267ff5acd9db5a1c (patch) | |
| tree | 95ac92e77058440bccbc5176b15bf4edc765bc7b | |
| parent | 2b55fef6b92bfaf8887f273c3d53928bc5035fc3 (diff) | |
| parent | a4c063274607532041d168d05f7f262d0f4b7763 (diff) | |
Merge "Telecom: Reset the duration after the CDMA call is accepted" am: 2cbf44dc2f am: e784d5e5ca
am: a4c0632746
Change-Id: I61fa87d7dda21d564baf57d798016d9f25d15387
6 files changed, 42 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 22958d4aed5e..62fc9c4234c7 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -843,6 +843,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) {} } /** @@ -2372,6 +2373,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); } |