Telephony: Add support for NETWORK_TYPE_GSM

Add support for NETWORK_TYPE_GSM in TelephonyManager and
corresponding mapping in ServicState.java so that when
application queries getVoiceNetworkType() and currently
camped rat is GSM, they get network mode as GSM instead
of network mode unknown.

Change-Id: I5e971c625532696776b9555ad8cfd85eba4fc423
CRs-Fixed: 526435
(cherry picked from commit 3e01fcec13725955f0ca3fb20730ff21f4edc128)
(cherry picked from commit c70f5687965908cd585e52901cf6cd88bd405140)
(cherry picked from commit 8e3c2300729ecb3cd3e6b640b0174f49e2189f0c)

Conflicts:
	telephony/java/android/telephony/TelephonyManager.java
Telephony: Add Managed Roaming Intent.

Introduce new intent with name ACTION_MANAGED_ROAMING_IND.
This intent is used to inform "location reject" status
information to applications.

Change-Id: I79c7ea2e647617e58526b5b550406214455a58aa
(cherry picked from commit 53f8c89c8c80fe6145828fce863d3e2dd44d3e53)
(cherry picked from commit 4d8c1003c621ca05473e8d5b0a1cfbdd81f9b66e)
(cherry picked from commit f266505d3431d4015adf72f63c6568ee4320bb9c)
Telephony: Initialize GsmCellLocation class members properly

Default values for class members mLac, mCid, mPsc would be 0.
Initialize these variables with -1 as 0 is considered as valid
value.

Change-Id: I08dc4031bb16293e80e5b7f51afcb8dc11747d3b
CRs-Fixed: 406479
(cherry picked from commit 416e0a2b6983af94245d8aa92d3aa0b1e0ce79aa)
(cherry picked from commit b25e0849cc2449fc95c3091a4599d4f72d2a436b)
(cherry picked from commit 5e48706429f229c8dd54f31a1e19a9a76618f591)
Telephony: Add functionality to handle ICC IO error

At present in Android all ICC Card states other than
ICC PRESENT are treated as ICC ABSENT.Adding functionality
to handle ICC IO error card state.

Change-Id: I229bd80cb5e487f4345bef9fb7fee60850f085d9
CRs-Fixed: 184479
(cherry picked from commit 5f414649d354f5b5f3208524e9827d488d183c76)
(cherry picked from commit fa5fb0852573189c107847da711ed61489cf92b5)
(cherry picked from commit 49e48d07a9cb7660d65ee3de30cf6e9f05bbc0ec)
Telephony: Add new apn.sim.operator_numeric property

Use new property to filter apns. We need this new property
because icc.operator_numeric property is also used in cdma
and ApnSetting UI might display wrong set of apns if the
peroperty value used was set by RuimRecords
CRs-Fixed: 362846

Change-Id: I3831a703a2fdc69df8552af57e0bb981d0c7e46f
(cherry picked from commit ec7c7b24a19a1a3c323aec9e0acc719bf85022ff)
(cherry picked from commit 6cc218bb1c2f0149c301c1ab07f57f67ccb424c8)
(cherry picked from commit e619c7e9e5cb7db48740d73c23d8cf90b25d5ff1)
Telephony: Add TD-SCDMA network modes

1)TD-SCDMA Signal Strength support.
2)Add TD-SCDMA network type support in MobileDataStateTracker class
to identify TD-SCDMA as UMTS variant and use the relevant
kernel data stack tcp buffer sizes defined.
3) Add TD-SCDMA to the list of supported network modes.

Change-Id: I158821574484bfaf47d1660406e591e2afb3be5e
CRs-Fixed: 403258, 479310
(cherry picked from commit 2ba1b7292c6b458fb72587c1f29a5c00b70717cd)
(cherry picked from commit d58b065e7e3d84461a3c981e7a7d4673f3567ef5)
(cherry picked from commit 7844d69d3d323b3969766309c2ad5bc80411fbae)

Conflicts:
	telephony/java/android/telephony/TelephonyManager.java
telephony: IMS changes for VoLTE and VT

- Add IMS phone type constant
- Add system property persist.radio.calls.on.ims.
  It is set to true if VoLTE/VT calls are supported,
  false otherwise

Change-Id: I1296184fd70ea6da2adabdc35ad1d2fb25cdfc70
(cherry picked from commit b6b39f1792231aa435af56b16a5a5c53a50a3845)
(cherry picked from commit 69ac4a60fb230442c718dae44ccf44d2e5d41b7d)
(cherry picked from commit 2748954064ea4aef5b047668534d9332bd671e01)
Telephony: Add data rat constant

This event constant is used in DcTracker

Change-Id: I1f9b34a8689c43c2586e9e3a92f0453649775d73
(cherry picked from commit f7ca98035479b670ff51bc9298fd7928a5e0f80d)
(cherry picked from commit f4d8f7b8fa390302b9cc51a5640e017ff393dfcc)
(cherry picked from commit 77d810390fbca8cb1d10bce148035fada414e0eb)
    CSVT: Introduce Circuit-Switch Video Telephony.

    Introduce CSVT Service which provides necessary API
    for Circuit-Switch Video Telephony.

Change-Id: I1d483212450720d64d05f4e2b02abf8da9f4b37e
(cherry picked from commit dc5000ac8e63e4009cb7a17c3d01aaa88353ed11)
(cherry picked from commit 93fcbbd2de9ff1ef4366ee25eea6c2ad3fb37d3c)
(cherry picked from commit 07b42287c38f0d280bd593288b2d152392272eef)
Property constants to support OMH

Add static constant variables required for OMH support

Change-Id: Idfeb2f3f1a3aa0403a7ff0ab7c69fc945d9e7083
(cherry picked from commit cf61f807ee07b4497da78c6bb753a835fa46b5b5)
(cherry picked from commit 8e68d056ca7c14fdefecbcf9b2b69048f092754a)
(cherry picked from commit 4a3b31e38c92bb1943c9290d8a4dd535b42bbd07)
Telephony: SMS over IMS

Add RIL_REQUEST_IMS_REGISTRATION_STATE, RIL_REQUEST_IMS_SEND_SMS, and
RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED.  Add FORMAT_UNKNOWN to
SmsConstants.

Change-Id: I87ca9841b4ace931c55e2d379fe6d7589b2dc8a5
(cherry picked from commit 876c2cdbcfb2650c30da158ecccf2d1eeaa7a916)
(cherry picked from commit f0cf40d0aa80b01607c394cc613a9ca708e4affe)
(cherry picked from commit 8ed4a4e1f2a0b9e86ddae0f5813bce41c6e312f8)
Update markings for the OMH changes

Update markings for the OMH gerrit: 478700

Change-Id: I4cdebe5f383efe1153bfc0a58bafb4168106736b
(cherry picked from commit 7adf9268e08978c9a458c98ee3465293e383c35c)
(cherry picked from commit 5ed1fe759759b41a1fa886a35f46ea2984700fdc)
(cherry picked from commit 5db5f0c0f7e5f57c81a0a4fe5a625f98f711a1ab)
Fix for data and roaming icons

- Enable data connected flag based on the data state.

- Do not display data icon in data connected state
if radio type is unknown

- Display data icon independent of voice service state
i.e even if voice network is unavailable

- Show cdma roaming indicators if either voice
or data is roaming.

- Cleanup roaming indicator default values.
Set default CDMA Eri index to roaming off

- Show service if either voice/data is in
service if ro.config.combined_signal is true

- Consider eri only when in service

- Add in service check to isCdmaEri.
roaming related information
in registration state will not be valid
during out of service.

Change-Id: I915421a6f5906d80ed5b8dd9c433115ad5df1f14
CRs-Fixed: 285986, 303275, 326204, 326634, 333008, 339297
(cherry picked from commit 7a3c1c35ed00f17dd345f824690877999dff2042)
(cherry picked from commit 83894db8b770d770891d42d078ba6d4dcfb29fb5)
Destination PS no: 2

Conflicts:
	core/res/res/values/config.xml
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
Telephony: STK CC feature implementation

Add strings and constants required for stk cc feature.

Change-Id: Id5ec987cdc8dc2d9eebdf01fe546eb96ec0c69f9
(cherry picked from commit 0647546916683963ba5191b4d013bd6ff3c7483d)
(cherry picked from commit 17e39ecff8e0ab7590308e78a0b2cfcf728693d5)
Telephony(MSIM): Add support for MultiSim

Make changes to add support for MultiSim.
  -Add TelephonyManager and TelePhonyRegistry for MultiSim
  -Add ITelephony and IPhoneSubinfo aidl files for MultiSim
  -Extend ShutdownThread to close all radio's for MultiSim
  -Add Constants and Utils used for MultiSim

Add prompt support for SMS
 - Add prompt option in SMS multi sim settings.
 - New iterface API to get SMS prompt is enabled or not.
 - Disply prompt while sending SMS, if user selects
   prompt mode in multi sim settings.

Change Default subscription property name.
 - Change default subscription property name from
   persist.default.subscription to persist.radio.default.sub so
   that it can be set by radio group access processes.

Subscription specific for Mobile data, roaming and usage
 - Provide database flags as per subscription for both Mobile
   data and Data roaming options.
 - Add function to provide DDS susbcriber id.

Set priority when send sms
 - Add the priority support in 3gpp2 text message

Add support for emergency calls
 -Populate ecclist by reading ril.ecclist corresponds to
  each subscription.
 -If dialed number is present in consolidated ecclist then
  mark as emergency number.

Define invalid subscription constant
 -Define a new constant for invalid subscription id.

Third Party Intent Handling
 -Remove firing of below intents from TelephonyRegistry when
  Multisim is enabled, as they will be fired from MSimTelephonyReistry
  ACTION_SERVICE_STATE_CHANGED
  ACTION_SIGNAL_STRENGTH_CHANGED
  ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
  ACTION_DATA_CONNECTION_FAILED
 -Remove below intent from both TelephonyRegistry & MSimTelephonyReistry
  as it will be fired in MSimDefaultNotifier.
   ACTION_PHONE_STATE_CHANGED

Change-Id: I6ee5d2a22e44fe7d0d68a41af0481ddbbbe21c3f
(cherry picked from commit 1014515bac8729ecc20493f763e00a3953c738e0)
(cherry picked from commit 021c08f412bc6117f9b139376371f3344d90abfb)

Conflicts:
	services/java/com/android/server/power/ShutdownThread.java
	telephony/java/android/telephony/PhoneStateListener.java
Telephony(MSIM): MultiSim support for PIN/PUK & Operator Name.

- Add CarrierText, SimPinView and SimPukView classes for MSIM.
  Add support to Display Multiple operator name.
  Add Support for Multiple PIN/PUK Lock screens.
  Overload few Keyguard methods to take sub info.

Add keyguard simpin/simpuk RTL-ization
 -Add support for SIM PIN and SIM PUK keyboards to keep the
  keys in the same position for all languages.

Add DETECTED state and PIN/PUK retry count.
 - Add App state DETECTED in the IccCardConstants.State enum.
   Modified logic for allowing PIN cancel based on number of
   cards configured/activated instead of number of cards present.
 - Add method in ITelephonyMSim.aidl to retrieve PIN1RetryCount.
   Display Attempts remaining in PIN/PUK lockscreen UI.
 - Clean up KeyguardUpdateMonitorCallback and MSimCarrierText by
   removing Initialize method from Callback.

Change-Id: I500129a5dc09adcb2cd8eb664d30ae2e8bad2642
(cherry picked from commit 13545ca99ffd932d9d04a94fb20f9669845b6f74)
(cherry picked from commit 1d7a713e73d4bd1964f62f8ae38852074bc0a9ad)

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardSecurityModel.java
(fixed)Telephony(MSIM): Add StatusBar support for MultiSim.

 -Add support for Signal Strength icon display for MultiSim
  Add support for NO SIM icon support for multiple SIMs.

Display dual subscription info in notification panel
  -Show subscription information for both subscriptions
   relevant to the sim state. if sim state is ready show
   operator name, if card absent, show no sim message,
   if UE is in airplane mode, show airplane mode message.

Clear data activity icon when disconnected
  -If data is disconnected before data activity becomes none,
   then clear up/down arrow icon by reset the data activity icon.

Add support for ro.config.combined_signal
  -Add support for ro.config.combined_signal. This property is being used
   to consider data service state for signal display.
   When ro.config.combined_signal is not set to false, we will display
   CS/PS signal strength whichever is available.

Change-Id: I11fb6ed37e7ba40b8db7840feedd109557128758
(cherry picked from commit 37ee8216eba253a61f9836b12f65bfe00f38e46c)
(cherry picked from commit 1e706857e70a03d2139fe1a8416321d603e008b6)

Conflicts:
	packages/SystemUI/res/layout/signal_cluster_view.xml
	packages/SystemUI/res/layout/status_bar_expanded.xml
	packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Telephony: 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: Iba74e3e5eb4fe96361585f4933897c5c8f17db97
CRs-fixed: 467276
Telephony: Handle DATA_CALL_LIST in DCC.

- Added async handling of NetStatPoll.

Change-Id: Ic77bb949ffb72fb3c54bacc6ad2a6ee87e877023
Add AppOps check for sendTextWithPriority

 Add application operation check for sendTextWithPriority API.

Change-Id: I802142f28a5ee11d59a35e9265ec968005777bae
CRs-Fixed: 571674