Don't display the option menu when all option menu items invisible

When all option menu items are invisible, return false in
onPrepareOptionsMenu(), don't display the blank option menu.

CRs-Fixed: 692040

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

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

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

Change-Id: I1afd28f1e6c5e26d504fe37bf3bc0f073236e130
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: 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
Add large text view for 'SET UP IDLE MODE TEXT'

With the current functionality the GCF test case
'GCF TC 27.22.4.22.1.7- SETUP IDLE MODE Text – large text string'
the text is not completely seen by the user.
Add big view notification style for displaying the text string
for 'SET UP IDLE MODE TEXT'.

Change-Id: I4a1abb6af4bb2a9122cde1afda4f13266da209f7
CRs-Fixed: 587675
Handle UNSOL_STK_EVENT_NOTIFY command message properly.

Currently, in scenario where the UNSOL_STK_EVENT_NOTIFY is
handled, and there is a main menu selection followed by, results
in sending of unwanted terminal response instead of envelope
command from the framework.

Set the CurrentCmd to MainCmd after launching the event
message in StkAppService, while handling UNSOL_STK_EVENT_NOTIFY.
This ensures the CurrentCmd still points to SEND_SMS instead of
SET_UP_MENU.

Change-Id: Iaef76df6d63cd056eceae4c6cfada175a41784e6
CRs-Fixed: 602357, 595595
Stk: Handle Null Alpha Identifer for Setup Call

- Per specification 102223 section 6.4.13:
  If the first alpha identifier is not provided by the UICC
  or is a null data object (ie. length is zero and has no
  value part) , the default setup call message is sent.

Change-Id: Ieb5eb25f004907ee68bea152e06b316da3ebfec0
Fix for Stk menu header not visible.

In the current L code, due to white background
color the Stk menu header is not visible.

Add color for title text in stk_title.xml to make
stk menu title visible.

Change-Id: I6e38ce2235a99a708a93bffe6ee2daf26e22a1fe
CRs-Fixed: 721612
Support to input  (0-9,*,# and +) in masked mode.

The InputType.TYPE_CLASS_NUMBER do not support to input the *,# and +.
Restore to the original code.

CRs-Fixed: 649431
Change-Id: Ic9c42627b0326695af7d5dbf2152d478381d905b
STK: CC feature implementation

Handle ALPHA_NOTIFY and display a toast mesage to user.

Conflicts:
	AndroidManifest.xml

Change-Id: I4f02237960003e9c6ebb477ea756923fd2598d0d
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

4) Stk: Update Manifest for modified Idle Screen Intent
Update StkCmdReceiver's intent-filter to use the updated idle
screen intent name

5) Stk: General Enhancements to StkAppService
i) Support GET_CHANNEL_STATUS command
ii)Set mMainCmd to null (SET_UP_MENU) only when we
   receive a remove menu command
iii)Cleanup idlemode text code: Removed the intent extra
    SCREEN_STATUS_REQUEST which is no longer used (introduced
    in the change (3) above).
CRs-Fixed: 517578

6) Handle LOCALE event properly

Change-Id: I978c8530e0f3a8813f2a7180bfb6bf40dcdc1ab0
Correct handling of Launch Browser command.

1) Stk: Create STK Default Url via System Property

- Create a default url, specific to the STK module that
  can be set via a system property.
- This url will be used when processing a launch browser
  proactive command that contains no url data associated
  with it.
CRs-Fixed: 557540

2) Stk: Update Launch Browser If Not Already Launched Behavior

- Since the default browser supports tabs, it will never be considered
  unavailable. Thus, there is no  need to send a terminal
  response with a browser unavailable result code.
- Suppress user confirmation when the browser mode is
  launch if not already launched and the alphaid is null or contains
  no text.
CRs-Fixed: 579426

Change-Id: I8187bb53e788d6a3e54a2138020f1d573adfe184
Stk: These changes are related to DISPLAY Text pro cmd

1. Handle high priority and normal priority display text
command correctly.

2. For display text with immediate response, send the terminal
response immediately after showing the text dialog. Block all
responses from StkDialogActivity, if display text is
with immediate response. Remove the check for response needed
in StkAppService, since un wanted responses are already
blocked in StkDialogActivity.

3. While the text is being displayed if a next Proactive command is
received, it should be acted upon immediately.

Change-Id: I8245d50048310633eed8b4011eadfb86a93765c4
Stk: Icon related changes

Return appropriate result code, if icon is not displayed
and display text msg only if icon display fails or if icon is not
self explanatory.

Change-Id: Ia421eb136d15c22e8090f2db93d00fcafe94164e
Stk: Add support for Activate cmd and HCI connectivity event

Add support for Activate proactive command defined in ETSI TS
102 223 [6.4.40] and HCI connectivity event defined in ETSI TS
102 223 [7.5.18].

Change-Id: I349a68e1a7c9e93349de0290d1795f1774460983
CRs-Fixed: 618962
MSIM: Add support for MSIM STK

Extended base stk functionality to support stk for
MultiSim. User will see upto 3 stk icons in launcher screen
if 3 cards inserted which support stk.

Conflicts:
	AndroidManifest.xml

Change-Id: Iaf2e8c6f1c7a1321fb8bc333fff0e58f255809a1
Do not inform user when the alpha identifier is a null data.

Current code is not in accordance with the spec
3GPP TS 11.14, 6.4.5. Play Tone, as user is informed when the
alpha identifier is a null data.

With reference to the spec, if there is no alpha identifier,
show the text message to the user depending on the config setting.

If alpha identifier data is null, play only tone and do not
inform the user.

Move the code to handle play tone from ToneDialog to StkAppService
in cases where only tone needs to be played and no user inform needed.

Dismiss the tone dialog from StkAppService after play tone finish.

Send the intent to StkAppService from ToneDialog to finish
the play tone, when user presses back key.

Ref spec: 3GPP TS 11.14, 6.4.5. Play Tone.

CRs-Fixed: 631723, 517578
Change-Id: I0acf11e86714138e6d3193b17181c6710d06dfb2
Handle the timer in StkMenuActivity correctly.

1. Currently the timer in StkMenuActivity is started only
if the state is SECONDARY.

While handling multiple back to back GET INPUT screens, the
timer in StkMenuActivity gets started, if the state is SECONDARY.
When this timer times out, it results in the GET INPUT screen
switch to main menu.Rename the timeout method and start the timer
in StkMenuActivity only if user input flag is true.

Change-Id: Id1c0f32952f3c6f78cc5b0b81ef8284f649c4c7f
CRs-Fixed: 651303

2. Cancel timeout when StkMenuActivity in main state

StkMenuActivity needs to start UI timeout only when in secondary
state. When the state of StkMenuActivity changes from secondary
to main, StkMenuActivity needs to cancel UI timeout, otherwise, Stk
will reject UI input after UI timeout, which will result in Stk
no response.

CRs-Fixed: 662655

Change-Id: I75781d9deae0ec8b29f6c01af98a7f7b89ec187a
Stk: Reginal requirement for RTL

Add flag for RTL support in manifest.
Convert left/right layout properties to start/end properties.
Keep the entry list LTR to follow the Arabic custom.

Change-Id: I4b2eff5b262f9bb9ea21c79b944921fec1ac7e2f
Stk: Stop the Stk App Service only if all SIMs are not ready.

In case of multisim, stop the stk service only if all the SIMs
are not ready.

Change-Id: Ic0e52749551b2d49d1b7ec4ca8870d65f31a7bae
CRs-Fixed: 739116