Add p2 option in OpenLogicalChannel

- Adding support for P2 parameter
- Needed to support OMAPI 3.0 defined
by SIM Alliance

Bug: 27360148
Change-Id: I4e09e033302b33c29ec0e2e06e76fc2c1b91f96d
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index da58d2b..7e64b69 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -485,6 +485,7 @@
                 case CMD_OPEN_CHANNEL:
                     request = (MainThreadRequest) msg.obj;
                     uiccCard = getUiccCardFromRequest(request);
+                    Pair<String, Integer> openChannelArgs = (Pair<String, Integer>) request.argument;
                     if (uiccCard == null) {
                         loge("iccOpenLogicalChannel: No UICC");
                         request.result = new IccOpenLogicalChannelResponse(-1,
@@ -494,7 +495,8 @@
                         }
                     } else {
                         onCompleted = obtainMessage(EVENT_OPEN_CHANNEL_DONE, request);
-                        uiccCard.iccOpenLogicalChannel((String)request.argument, onCompleted);
+                        uiccCard.iccOpenLogicalChannel(openChannelArgs.first,
+                                openChannelArgs.second, onCompleted);
                     }
                     break;
 
@@ -2268,12 +2270,12 @@
     }
 
     @Override
-    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID) {
+    public IccOpenLogicalChannelResponse iccOpenLogicalChannel(int subId, String AID, int p2) {
         enforceModifyPermissionOrCarrierPrivilege(subId);
 
-        if (DBG) log("iccOpenLogicalChannel: subId=" + subId + " aid=" + AID);
+        if (DBG) log("iccOpenLogicalChannel: subId=" + subId + " aid=" + AID + " p2=" + p2);
         IccOpenLogicalChannelResponse response = (IccOpenLogicalChannelResponse)sendRequest(
-            CMD_OPEN_CHANNEL, AID, subId);
+            CMD_OPEN_CHANNEL, new Pair<String, Integer>(AID, p2), subId);
         if (DBG) log("iccOpenLogicalChannel: " + response);
         return response;
     }