Stk: Open Channel Fixes

StkAppService: Fix OPEN CHANNEL user confirmation

-On receipt of OPEN CHANNEL , user confirmation needs to be set
if user acknowledges the message / command.

Stk: Show 'Toast indications' SEND DATA / RECV DATA and CLOSE CHANNEL

- Displaying Toast indication yields better UI experience when there are
multiple SEND / RCV DATA proactive commands in a single OPEN CHANNEL
session.

Bug: 10602211
Change-Id: Ib2ba51f9a41e875311e76943eae082d9e45f33c5
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index c0ba74c..42e8e01 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -470,7 +470,10 @@
                     break;
                 }
             }
-            launchTransientEventMessage();
+            /*
+             * Display indication in the form of a toast to the user if required.
+             */
+            launchEventMessage();
             break;
         }
 
@@ -500,6 +503,7 @@
 
         // set result code
         boolean helpRequired = args.getBoolean(HELP, false);
+        boolean confirmed    = false;
 
         switch(args.getInt(RES_ID)) {
         case RES_ID_MENU_SELECTION:
@@ -537,7 +541,7 @@
             break;
         case RES_ID_CONFIRM:
             CatLog.d(this, "RES_ID_CONFIRM");
-            boolean confirmed = args.getBoolean(CONFIRMATION);
+            confirmed = args.getBoolean(CONFIRMATION);
             switch (mCurrentCmd.getCmdType()) {
             case DISPLAY_TEXT:
                 resMsg.setResultCode(confirmed ? ResultCode.OK
@@ -591,12 +595,19 @@
             switch (choice) {
                 case YES:
                     resMsg.setResultCode(ResultCode.OK);
+                    confirmed = true;
                     break;
                 case NO:
                     resMsg.setResultCode(ResultCode.USER_NOT_ACCEPT);
                     break;
             }
+
+            if (mCurrentCmd.getCmdType().value() == AppInterface.CommandType.OPEN_CHANNEL
+                    .value()) {
+                resMsg.setConfirmation(confirmed);
+            }
             break;
+
         default:
             CatLog.d(this, "Unknown result id");
             return;