Merge "Telecom: Reset the duration after the CDMA call is accepted" am: 2cbf44dc2f am: e784d5e5ca
am: a4c0632746
Change-Id: I61fa87d7dda21d564baf57d798016d9f25d15387
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 22958d4..62fc9c4 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -843,6 +843,7 @@
public void onRemoteRttRequest(Connection c) {}
/** @hide */
public void onPhoneAccountChanged(Connection c, PhoneAccountHandle pHandle) {}
+ public void onConnectionTimeReset(Connection c) {}
}
/**
@@ -2372,6 +2373,16 @@
}
/**
+ * @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 aa790f7..4c2d22f 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -1474,6 +1474,13 @@
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 0d319bb..520e7ed 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -255,6 +255,18 @@
}
/**
+ * 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 3e1bf77..78d65e6 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -610,6 +610,11 @@
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 bb4b483..9821dcb 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -466,6 +466,11 @@
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 be474bd..0157a58 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
@@ -121,4 +121,6 @@
in Session.Info sessionInfo);
void onConnectionServiceFocusReleased(in Session.Info sessionInfo);
+
+ void resetConnectionTime(String callIdi, in Session.Info sessionInfo);
}