Merge "Properly convert GENERIC_CONFERENCE capabilities."
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 7014b9b..992a324 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -497,7 +497,7 @@
         boolean isAddParticipant = ((extras != null) && (extras.getBoolean(
                 TelephonyProperties.ADD_PARTICIPANT_KEY, false)));
         if (isAddParticipant) {
-            addParticipant(handle.toString());
+            addParticipant(handle.getSchemeSpecificPart());
             mInCallController.bringToForeground(false);
             return null;
         }
diff --git a/src/com/android/server/telecom/InCallController.java b/src/com/android/server/telecom/InCallController.java
index d3ca751..b406db5 100755
--- a/src/com/android/server/telecom/InCallController.java
+++ b/src/com/android/server/telecom/InCallController.java
@@ -522,10 +522,7 @@
                 }
                 childCallIds.add(mCallIdMapper.getCallId(child));
             }
-
-            if (childConnectTimeMillis != Long.MAX_VALUE) {
-                connectTimeMillis = childConnectTimeMillis;
-            }
+            connectTimeMillis = Math.min(connectTimeMillis, childConnectTimeMillis);
         }
 
         if (call.isRespondViaSmsCapable()) {
diff --git a/src/com/android/server/telecom/PhoneAccountRegistrar.java b/src/com/android/server/telecom/PhoneAccountRegistrar.java
old mode 100644
new mode 100755
index a677212..9fc1cd9
--- a/src/com/android/server/telecom/PhoneAccountRegistrar.java
+++ b/src/com/android/server/telecom/PhoneAccountRegistrar.java
@@ -213,7 +213,7 @@
     }
 
     PhoneAccountHandle getUserSelectedVoicePhoneAccount() {
-        long voiceSubId = SubscriptionManager.getDefaultVoiceSubId();
+        int voiceSubId = SubscriptionManager.getDefaultVoiceSubId();
         boolean isVoicePrompt = SubscriptionManager.isVoicePromptEnabled();
         PhoneAccountHandle prefPhoneAccount = null;
 
@@ -228,9 +228,9 @@
                    Log.i(this, "getUserSelVoicePhoneAccount, emergency account ");
                    return mState.accounts.get(i).getAccountHandle();
                 }
-                long subId = voiceSubId;
+                int subId = voiceSubId;
                 try {
-                    subId = Long.parseLong(id);
+                    subId = Integer.parseInt(id);
                 } catch (NumberFormatException e) {
                     Log.w(this, " NumberFormatException " + e);
                 }
diff --git a/src/com/android/server/telecom/RespondViaSmsManager.java b/src/com/android/server/telecom/RespondViaSmsManager.java
old mode 100644
new mode 100755
index e48e3ee..5d53d0b
--- a/src/com/android/server/telecom/RespondViaSmsManager.java
+++ b/src/com/android/server/telecom/RespondViaSmsManager.java
@@ -144,10 +144,10 @@
     @Override
     public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
         if (call != null && rejectWithMessage) {
-            long subId = SubscriptionManager.getDefaultSubId();
+            int subId = SubscriptionManager.getDefaultSubId();
             if (call.getTargetPhoneAccount() != null) {
                 try {
-                    subId = Long.parseLong(call.getTargetPhoneAccount().getId());
+                    subId = Integer.parseInt(call.getTargetPhoneAccount().getId());
                 } catch (NumberFormatException e) {
                     Log.e(RespondViaSmsManager.this, e , "Exception e ");
                 }
diff --git a/src/com/android/server/telecom/TelecomService.java b/src/com/android/server/telecom/TelecomService.java
old mode 100644
new mode 100755
index 08131b4..b655af9
--- a/src/com/android/server/telecom/TelecomService.java
+++ b/src/com/android/server/telecom/TelecomService.java
@@ -623,7 +623,7 @@
             long token = Binder.clearCallingIdentity();
             String retval = "content://icc/adn/";
             try {
-                long subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle);
+                int subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount(accountHandle);
                 retval = retval + "subId/" + subId;
             } finally {
                 Binder.restoreCallingIdentity(token);