Stk: Erase SELECT_ITEM when SELECT_ITEM timer expired

Wait for 10 sec for select item response from network.
If any delay is there more than 10 sec from network
erase SELECT_ITEM.

Change-Id: If4b4b01603b33b2346db7930f87d39f6648b3bf1
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.

CRs-Fixed: 351846

Change-Id: Ia9327ebcab9aab000a8c570df06375297a1d7254

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.

CRs-Fixed:  344570
Stk: Timer Related Fixes

Stk: Timer not getting cancelled after user response

After user response, the timer should be cancelled.
Else the timer would expire and sends an untimely
Terminal response with RES_ID_TIMEOUT.

Change-Id: If0db10741afe36d619d4beb245ea62581d3cb98b
CRs-Fixed: 380634, 390635

Stk: StkDialog activity should not cancel timer when it is paused

During display text,  if any higher / lower priority events
such as incoming call, new sms, screen off intent,
notification alerts, user actions such as 'User moving to
another activtiy' etc.. occur during Display Text ongoing session,
this activity would receive 'onPause()' evt resulting in
cancellation of the timer. As a result no terminal response is
sent to the card

CRs-Fixed: 347841

Change-Id: I72be23ca5a99f995f03684e8bfdd6f3c8708363a

Stk: StkMenu/StkInput activity should not cancel timer when paused

During SelectItem / GetInkey / GetInput, if any
higher / lower priority events such as incoming call,
new sms, screen off intent,notification alerts,
user actions such as 'User moving to another activtiy' etc..
occur during SELECT ITEM / GETINKEY / GETINPUT ongoing session
respectively, the respective activity would receive
'onPause()' evt resulting in cancellation of the timer.
As a result no terminal response is sent to the card

CRs-Fixed: 349410
Stk: These changes are related to DISPLAY Text pro cmd

The following issues related to DISPLAY_TEXT are fixed in this change:

1. Send the Terminal Response if ResponseNeeded qualifier is set, after
the default duration else display message for ever.

2. Currently the STK App is sending "screen busy" terminal response for
Subsequent display text proactive commands if a previous display text is
being displayed. Changes are made to update the dialog box with the
subsequent display text and not to send the screen busy.
(Refer to ETSI TS 102.384 section 27.22.4.1.4.4.2) .

3. When a high priority Display Text proactive command with infinite
time out is sent,user has to clear this message. The Terminal Response for
this command will be sent from Stk framework itself. Stk app receives
this message and displays it until user clears it. In between other
proactive commands like Play Tone can be processed parallely. The
Terminal Response for Play Tone command is not sent if the Display Text message
is not cleared because of improper handling. This is corrected.

4. When a high priority, wait for user clear and no timeout Display Text
Proactive command is received UE should display the text until user
clears it. While the text is being displayed if a next Proactive command is
received, it should be acted upon immediately.

5.Don't consider screen busy if STK related activity is displayed.

We could receive display text proactive command while an STK
activity is already being displayed. In this case, don't check for
idle screen before displaying the activity.

Change-Id: I8245d50048310633eed8b4011eadfb86a93765c4
CRs-Fixed: 454191
Stk: Usat Phase 2 feature support

This change combines the following fixes:

1) Usat Phase 2 feature support
Added changes to support Idle screen, Language Selection.
Fix Display Alpha for proactive commands
CRs-Fixed: 432647

2) Fix to display dialog for DISPLAY_TEXT commands
For Display Text commands that are low priority, we check the
Idle Screen status before displaying the dialog. However, the handling
for the result of the Idle Screen request is missing. Add this handling.
CRs-Fixed: 442763

3) Fix crash on Idle Mode Text proactive command
After checking for screen status, use the saved command object
to process the Idle Mode Text command.
CRs-Fixed: 448079

Change-Id: I978c8530e0f3a8813f2a7180bfb6bf40dcdc1ab0
STK: CC feature implementation

Handle ALPHA_NOTIFY and display a toast mesage to user.

Change-Id: I4f02237960003e9c6ebb477ea756923fd2598d0d
Stk: Support for modem re-start and ICC refresh

Uninstall the STK app, stop StkAppService and remove the idle text
when StkAppService receives the CARD_ABSENT/CARD_ERROR status.

IdleModeText and SETUP_MENU need to be cleared when a card refresh
occurs.

Change-Id: I626ff5196270377d02c570703f46c5b272a115fd
Stk(MSIM): Add support for MSIM STK
Extended base stk functionality to support stk for
3 different cards. User will see 3 stk icons in launcher screen
if 3 cards inserted which support stk.

Change-Id: Iaf2e8c6f1c7a1321fb8bc333fff0e58f255809a1
Stk: Add Support for alpha in REFRESH command.

RIL_UNSOL_STK_EVENT_NOTIFY is given by RIL in case there is alpha
id to be displayed to user in refresh proactive cmd.
Support is added to display Alpha id to user when this event comes
due to REFRESH proactive cmd.
Also if refresh mode is init or reset, idle mode text needs to be
cleared as per stk 3GPP spec 11.14. This logic is handled in stk
app to satisfy both the above requiremnts.

CRs-Fixed: 474693

Change-Id: I277f27db200468dd8ca49dbf6959277f09db0c67
(cherry picked from commit dd81bf59e5ff06c7c9d3a2df1794bb291774a2e3)
Stk(MSIM) : Read Slot ID from card status change intent.

StkCmdReceiver was not reading the Slot ID parameter from Card status
changed broadcast intent coming from CatService.All events were being
forwarded to Slot 0 by default in StkAppService.Hence card absent status
was not notified to Stk App2 handler on APM enabled.

Change-Id: I62722e9e88a156695d1cc7772ec585136493805d
Stk: Check and update CatService instance before sending
event response.

CatService pointer mStkService[i] may be null in cases like CatService
not ready at init or after an APM enable.sendSetUpEventResponse()
was not checking whether there is a valid CatService instance
before trying to send response leading to null pointer exception.

CRs-Fixed: 518348

Change-Id: I054bacd22a18f0a1a11a24ecf08968f2018a5a54
Merge "Stk(MSIM) : Read Slot ID from card status change intent."
Merge "Stk: Check and update CatService instance before sending event response."
Merge "Stk: Add Support for alpha in REFRESH command."
Add isBrowserLaunched API.

isBrowserLaunched API is required to check whether the
browser has been launched or not while the browser launch
mode is set to LAUNCH_IF_NOT_ALREADY_LAUNCHED.

Change-Id: If16061a2688448cfcd62d687873835435d1d56a7
CRs-Fixed: 538806
Merge "Add isBrowserLaunched API."
Merge branch 'jb_mr2' of git://codeaurora.org/platform/packages/apps/Stk into cm-10.2
Merge branch 'qcril' into cm-10.2