Add TD-SCDMA UI support

Add TD-SCDMA PreferredNetwork display changes.
Add network mode TD-SCDMA to the list of
supported network modes.

Change-Id: Ib5adbf37e0fd3f17b64e64bc5b8a9d32e129af70
CRs-Fixed: 479310
(cherry picked from commit e0c7eba36ffcab551bddf9838f49278efec3f63b)
(cherry picked from commit be1bc56a5664bab05a896d8aebf808c07e946a44)
(cherry picked from commit 2275e2a28de775192675d7decbaf9d534bc312db)
STK Call Control feature implementation.

Support to display the exact call failure reason
for STK cc.

Change-Id: I7b0678b8bd566593270d0d9b3459400a8fd08803
(cherry picked from commit bdf6734eb20ab5d2dc08575ce9c53465a6222d0d)
(cherry picked from commit c521f6b2228065f6832ef3e11f641fe669cf147e)
(cherry picked from commit 8831d98be68d2467f92f13738a6843c5bed85f6d)
Add Managed Roaming feature support.

Add support to listen for Managed Roaming intent and
based on the received intent information display a pop-up
notification to user to provide an option to perform manual
network scan operation.

Change-Id: I67118e1e351aab5ce7eabc71bd7ced831bdbb944
(cherry picked from commit 5fd002edcbad399b5072642c78207e11a3586667)
(cherry picked from commit 3a5eee47f062e55ab5980e158441d358957a4967)
(cherry picked from commit 4e553b86b74be09dc48df5e3c2fccd17349760f7)
Phone: Display message to indicate PIN/PUK status changes.

Changes done to display retry counter on wrong entry of PIN1,
and message to indicate Code accepted/PIN1 blocked during
PIN1 verification as per certain carrier requirements.
PhoneApp: Add APIs that report actual error code on PIN/PUK operations
The current APIs that are used to verify the PIN and PUK only convey
whether the operation succeeded or failed. As a result on ANY failure
clients ask the user to re-enter the PIN.
Add 2 new APIs that report the actual error code in case of failure.
CRs-Fixed: 357021, 441001

Change-Id: I01a4cf9dc1fbccdb8944eb59e10fef8f306a7f6e
(cherry picked from commit e3487069216e046e967ac78c3553bbfd0205330e)
(cherry picked from commit ab1f94540d333134109ae805a13edb93448e984a)
(cherry picked from commit 93920ca38b4398420ace3da316f12fdec9df213f)
Phone: IMS changes

- Place IMS call if the call domain is PS and the URI scheme is sip
- Add UI for adding IMS settings
- Fix merge call and add call support
- Fix missed PHONE_TYPE_IMS case
- Fix IMS phone to behave like GSM phone in CallNofifier.run
  TONE_BUSY case
- Use Ims Service to create IMS phone
- Handle Ims not registered in App
- Support for emergency calls over IMS
- Handle voLTE call end properly
- UT interface support for IMS
- Support for Conference Event Package UI
- Add support for manage conference when no conf event package
- IMS conference uri
- Expose information via ImsService
- While in 1x call, originate new call on 1x
- Handle ECBM for ImsPhone
- Move CallDetails constants to PhoneConstants
- Copyright changes for IMS files
- Change Add Call functionality & Ecc call logic
- Added PHONE_TYPE_IMS to handle crash
- Fix UI for exception error scenarios for Supplementary srv setting
- Aidl changes for Hangup feature
- Fix not to strip separators for conference
- ECBM exit scenario

Change-Id: I0fcfd61e0e54d2dca601ac9db87ec40abc7748d4
CRs-Fixed: 407196 421082 478436 478439 474115 483481 491023
           445594 513188 519508
(cherry picked from commit d62c3e4f52dbf0fc3d506753549595405520225e)
(cherry picked from commit c5c2376cd17ee96d1c123644af2510f125dcd3c4)
(cherry picked from commit 367fea457afe8dec23dac1b5190edece0e045539)
Phone: Check for radio state properly

The implementation of ITelephony.isRadioOn() method checks for
service state instead of radio state. In cases of basebandless
targets, service state is not changed and would remain in the
initialized OUT_OF_SERVICE state. This causes delay in shutdown
procedure for such targets.

Hence a method isRadioOn() is added in phone interface and is
used to get the radio state.

Change-Id: I5a60aa39170f9d2863e95109dfd54cbd29ffdf47
CRs-Fixed: 502317
(cherry picked from commit 796660b84122dedf73091510e65a98cba5b9998b)
(cherry picked from commit 612eaffde01424e7ce4346d670542f2b8e7a47b7)
Display Supplementary Service Notifications

As per spec 27.007 - 7.17, Supplementary services notification
should be displayed to the user.
CallStateMonitor registers for SVC notifications and passes them to
registered handlers.CallNotifier handles notification and displays
message in the form of Toast to the user with the appropriate
text depending on the type of notification.

Change-Id: I69050b1b8caba5602af7bb8e45eb5a8c8b34a6f5
(cherry picked from commit aa437c6c226ff907e48a7d9ae95b31ed58a2dcbd)
(cherry picked from commit e8ace2534c851274b615edcdf26e8b886b728fb8)
SimContacts: Add support for manage SIM Contacts.

Add support for new options in SimContacts
    1) Add New contacts to SIM
    2) Delete/Edit Contact in SIM
    3) Dial/SMS using SIM contact
    4) Export all Phone contacts to SIM

Change-Id: Ic428111f548c294f956906e92a0839eed5ae137e
(cherry picked from commit 55c8cf9f95a7bbba41a189c90926b7c830b52cf3)
(cherry picked from commit b0e8786cca94227e2ebbe853399ff7cba82a4df1)
MSIM: Add support for MultiSim.

-DSDS support
   Make changes to support voice call for DSDS
   Extend FDN Settings, Mobile Network Settings
   Call Settings etc for DSDS.

-DSDA support
   Extended few PhoneApp classes to support simultaneous voice
   calls on both subscriptions.
  -PhoneUtils: added few utilities requird for dsda.
  -MSimNotificationMgr for displaying notifications on
   both subscriptions.
  -MSimCallNotifier for dsda incoming call handling.

-TSTS support

-Tab view support for Subscription selection.

-Subscription specific for Mobile data, roaming and usage
  -Provide per subscription based support for both Mobile Data
   and Data roaming options. UI and functionality changes in:
   a. Settings -> Data Usage application
   b. Settings -> Mobile Networks menu.

-Support for Pin/Puk in MultiSim scenarios
  -Add support to handle PIN/PUK MMI commands on voice
   preferred subscription for multisim

-Phone(DSDA): Add following tones support for DSDA
  -Local Call Hold reminder support.
  -Supervisory Call Hold tone.
  -Local Call Waiting tone.

-Add Global mode Support for MultiSim.

Change-Id: I76be3236258aa98e0ffc3b2a1f313f03d42a7b17
CRs-Fixed: 467726 503932
(cherry picked from commit 2a98db1388fba812fedb35ed8fcc24bfeb07e32c)
(cherry picked from commit 52d879e650d46dd9a47c85491a48e53d0f4aa209)
Phone(MSIM): Add support for X-Divert Feature

On enabling XDivert following operations will happen:
-> CFNRc of Sub1 will be set to Sub2 number.
-> CFNRc of Sub2 will be set to Sub1 number.
-> CW for Sub1 & Sub2 enabled.

Following enhancements have been made for XDivert feature:
-> Icon display on statusbar when XDivert feature is enabled
-> Icon will be cleared when any subscription is deactivated
   or sim is removed on fly.
-> Icon will be shown on next powerup, if XDivert was enabled
   and same SIMs are inserted.
-> Phone numbers of both the subscription populated automatically
   from 2nd time onwards, when the sims are not changed across
   powercycle.
-> When XDivert is enabled, feature status is displayed when the
   notification bar is expanded.

Change-Id: I66742b23a1ba0614104f8c36fac11448fde6224e
(cherry picked from commit c3187c184231931fdc6d4ae43497f4dd87292f9a)
(cherry picked from commit 44695fee6d2b32313b25b659ff724817baa036d8)
Phone(MSIM): Add MSIM Voicemail and Call forwarding icons.

Add support to display Voicemail and Call forwarding icons for MSIM.
MSIM Voice mail and Call forwarding icons are added in PhoneApp so
that these icons are not publicly exposed.

Change-Id: Ie9dee534b8db78cfa9af57b75638db10e62f1fa8
CRs-Fixed: 373471,441194
(cherry picked from commit 324391c9cac7b7deb1a5e3314e690476f552b75d)
(cherry picked from commit 81003f80d3ad28032028d6ff1d568c84c2c916fb)
Add ME Depersonalization support.

Add support for all ME De-Personalizations as per specs
3GPP2 C.S0068-0 and 3GPP TS 22.022.

Change-Id: I70272a596a4ed6c7cf526ea7e944facebb7ce41d
CRs-Fixed: 467276
Add support for Manage SIM Contacts for MultiSim.

ExportContactsToSim.java
Add Support for Exporting SIM contacts for all available SIMs.

Avoid using ManagedCursor as cursor lifecycle is dependent
on the activity's lifecycle. But Export contacts to SIM
need cursor even if activity is not in foreground.

SimContacts.java
Do not dismiss progress dialog when activity is not in
foreground to avoid the runtime exception.

MSimContacts.java
Add support for Managing SIM contacts for all available SIMs.

Change-Id: Ib2f7907ca7b008455f39ba0a3eae78b34b75513f
Merge "Add ME Depersonalization support."
Update Settings DB with correct Preferred NW mode

Introduction of mButtonEnabledNetworks preference does not ensure
the correct value of preferred network mode in Settings DB. So, the
User chosen mode does not retain. Both the preference objects are
handled properly to ensure right preferred network mode in the DB.

Change-Id: I35c4b231d5e61ac3efd71dd43b3a88a9ad9586fd
CRs-Fixed: 571980
Merge "Add support for Manage SIM Contacts for MultiSim."
Merge "Update Settings DB with correct Preferred NW mode"
Fix emergency call hang during voice radio tech change.

Sometimes (like in case of radio tech change during emergency call)
Connection objects below CallManager, gets disposed and recreated
without a DISCONNECT event reaching CallManager and upper layers.
CallManager retrieves the current calls/connections from active phones
after radio tech change.
Cleanup local connections/Calls in TeleService which are not
present in CallManager.

Change-Id: I7bb841219d14a2899030b176691348cfe824bf47
CRs-Fixed: 564190
Fix waiting call answer issue

When hold and active call exists, to answer the new incoming call
 -hangupActiveCall() method alone is sufficient
 -Do not call answerCall() method, which is causing to switch
  the answered call to hold state.

Change-Id: Id395abea172adc78c90acd7333806ec1b11173f9
CRs-Fixed: 436818
Merge "Fix emergency call hang during voice radio tech change."