Fixing issue where VoLTE conference calls have incorrect call time.

1. In constructor for "Call", setting connect time for new conferences;
the connect time is normally set when a call goes ACTIVE, but since a
conference starts active it never gets a state change to active.
2. Changed code in InCallController which finds oldest connected child
call to handle the potential case where no children have a connect time
defined.  This can occur when an IMS conference has just started and
conference event package participants are added.  Since they are initially
added as "NEW", it is possible for there to be no active child call, which
could cause the timer to glitch until the child calls become active.

Bug: 18511011
Change-Id: I36782db8f89299c31e6f489d34a83701855d30c8
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 47b4aa6f..2117ae8 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -332,6 +332,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 d3cc232..de48ead 100644
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -488,13 +488,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 ?