Passing subscription info in the calls logic to log it properly

In order to log the subscription information in call history and call
log, the calls logic layer needs to pass the information between classes
in the process.

Bug: 15473965

Change-Id: I85ca5444e5881a8ceb0eb950dfc6385cacd045cf
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 9b4bf80..09f60cf 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -29,6 +29,7 @@
 import android.telecomm.GatewayInfo;
 import android.telecomm.InCallService;
 import android.telecomm.Response;
+import android.telecomm.Subscription;
 import android.telecomm.TelecommConstants;
 import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
@@ -115,6 +116,8 @@
      * service. */
     private final GatewayInfo mGatewayInfo;
 
+    private final Subscription mSubscription;
+
     private final Handler mHandler = new Handler();
 
     private long mConnectTimeMillis;
@@ -209,7 +212,7 @@
      * @param isIncoming True if this is an incoming call.
      */
     Call(boolean isIncoming, boolean isConference) {
-        this(null, null, isIncoming, isConference);
+        this(null, null, null, isIncoming, isConference);
     }
 
     /**
@@ -217,12 +220,15 @@
      *
      * @param handle The handle to dial.
      * @param gatewayInfo Gateway information to use for the call.
+     * @param subscription Subscription information to use for the call.
      * @param isIncoming True if this is an incoming call.
      */
-    Call(Uri handle, GatewayInfo gatewayInfo, boolean isIncoming, boolean isConference) {
+    Call(Uri handle, GatewayInfo gatewayInfo, Subscription subscription,
+            boolean isIncoming, boolean isConference) {
         mState = isConference ? CallState.ACTIVE : CallState.NEW;
         setHandle(handle);
         mGatewayInfo = gatewayInfo;
+        mSubscription = subscription;
         mIsIncoming = isIncoming;
         mIsConference = isConference;
         maybeLoadCannedSmsResponses();
@@ -348,6 +354,10 @@
         return mGatewayInfo;
     }
 
+    Subscription getSubscription() {
+        return mSubscription;
+    }
+
     boolean isIncoming() {
         return mIsIncoming;
     }
@@ -712,7 +722,8 @@
                     mGatewayInfo.getOriginalHandle());
 
         }
-        return new CallInfo(callId, mState, mHandle, mGatewayInfo, extras, descriptor);
+        return new CallInfo(callId, mState, mHandle, mGatewayInfo, mSubscription,
+                extras, descriptor);
     }
 
     /** Checks if this is a live call or not. */