Merge "Fixing issue where VoLTE conference calls have incorrect call time." into lmp-mr1-dev
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 19b7fdb..3e66426 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -331,6 +331,13 @@
boolean isIncoming,
boolean isConference) {
mState = isConference ? CallState.ACTIVE : CallState.NEW;
+
+ // Conference calls are considered connected upon adding to Telecom, so set the connect
+ // time now.
+ if (isConference) {
+ mConnectTimeMillis = System.currentTimeMillis();
+ }
+
mContext = context;
mRepository = repository;
setHandle(handle);
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index 3b4af57..4698c61 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -493,13 +493,18 @@
List<Call> childCalls = call.getChildCalls();
List<String> childCallIds = new ArrayList<>();
if (!childCalls.isEmpty()) {
- connectTimeMillis = Long.MAX_VALUE;
+ long childConnectTimeMillis = Long.MAX_VALUE;
for (Call child : childCalls) {
if (child.getConnectTimeMillis() > 0) {
- connectTimeMillis = Math.min(child.getConnectTimeMillis(), connectTimeMillis);
+ childConnectTimeMillis = Math.min(child.getConnectTimeMillis(),
+ childConnectTimeMillis);
}
childCallIds.add(mCallIdMapper.getCallId(child));
}
+
+ if (childConnectTimeMillis != Long.MAX_VALUE) {
+ connectTimeMillis = childConnectTimeMillis;
+ }
}
Uri handle = call.getHandlePresentation() == TelecomManager.PRESENTATION_ALLOWED ?