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)
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: Avoid Infinite loop problem in Tethering

1. Whenever data is enabled we will try to establish the tethered
call (USB tethering enabled case) for 5 fixed number of retries.
After reaching maximum number of retries we are turning off the
upstream connection. whenever the CONNECTIVTY_ACTION received
(because of USB cable disconnected and then connected case or
some changes), it can try to bring up the dun/hipri PDP again.

2. There is no retry in case of data disabled case.

Change-Id: I16af4d2983a8bf9ce0ce904877f86169bca549b4
CRs-Fixed: 401829
(cherry picked from commit 4c923c8537fdc49ef491b964adc1871c77bfd730)
(cherry picked from commit 3135e6a89ac14008df04fe6e068bd8dd95b4ee40)
(cherry picked from commit 137b7004f716a559c7249be20e25544fe10330b6)
Telephony: Do not send Radio Power Off on SIM_RESET

Changes made to not to send radio power off during refresh app
reset.

Change-Id: I83b7063a86ce9b380c7aeb0c140a4967d205d93b
CRs-Fixed: 441924
(cherry picked from commit 41b19b200620229deda8385478499d2cf5b794d5)
(cherry picked from commit 9b13254fe3d25ed8ba222713b95027a0930dc324)
(cherry picked from commit 601891892d9a5851ffedd64c186055406ddb4ca1)
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: 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)
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/ServiceState.java
	telephony/java/android/telephony/SignalStrength.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)
Telephony: Add NET_RAW,NET_ADMIN,QCOM_DIAG, CAMERA capability

NET_RAW, NET_ADMIN, QCOM_DIAG, CAMERA capability is added
to radio user in PackageManager
This change is needed to allow IMS DPL Thin client
(media handling library for IMS/VT) access
to qmi ports it needs to talk to the DPL on the modem side.

Change-Id: Ic43c773224d5cf3fb726902b0447212d0da97929
CRs-Fixed: 365959
(cherry picked from commit ff7f8aa8113e9fb7d4fdcd71ba5dfa16e734d0c6)
(cherry picked from commit d20e5e553ede06e368faa7ce04a131196973bc55)
(cherry picked from commit 89163128e80117ac32db1da115f05be263d5a394)
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)
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)
Initial bringup frameworks-base

Change-Id: I6139dcf0242cc202d1dcef923047acd826279ecf

Conflicts:
	core/res/res/values/strings.xml
(cherry picked from commit e967ee02698585592bea9a276f4b706302c00da8)
(cherry picked from commit dae69c5768b0096cddccca07c72bf82fc57209eb)
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
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)

Conflicts:
	telephony/java/com/android/internal/telephony/RILConstants.java
Fix fatal exception due to missing looper for current thread.

While creating handler for the thread, there was fatal exception getting
thrown because the present thread does not have a looper. So passing the
applications looper to be used , while creating the handler to avoid this
exception.

Change-Id: Id2e3ed61f5691c8319eb7bc20ad970eb6758e765
(cherry picked from commit f5d1769b4357fb8d86fc31f7115b55b567a20ed1)
(cherry picked from commit d0a7c5833b90fe4d8fe8f968b53a7028720ffd8c)
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/SystemServer.java
	telephony/java/com/android/internal/telephony/RILConstants.java
	telephony/java/com/android/internal/telephony/TelephonyProperties.java
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:
	core/res/res/values/symbols.xml
	packages/SystemUI/res/layout/signal_cluster_view.xml
	packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java