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)
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)
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)
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
Telephony: Update TD-SCDMA Network Type String

- Updating the string used to identify TD-SCDMA network type
  to be consistent with the ServiceState string.

Change-Id: I5aee8728ee80dc199f37414aba9019523082862c
CRs-Fixed: 564062
Telephony: Ignore the timingAdvance field in SignalStrength

Ignore the timingAdvance field since the frameworks is not
utilizing this field.

Change-Id: I8644f20aa1918514da88db5a8bc7394263d61e30
Fix data disconnect issue on G sub for C+G DSDS

On a DSDS Cdma+Gsm device, when data is registered on both Cdma and Gsm
subscriptions and DDS is on Gsm sub, if data deregister happens on Cdma
sub, data disconnect is getting propagated to connectivity service
irrespective of DDS, hence data is getting disconnected on Gsm sub.

Add code changes to block data disconnect getting propagated to
connectivity service when the subscription is not DDS.

Change-Id: I329d6a20ace65cad494e36dd9ec5a6470db2fbd7
CRs-Fixed: 544292
Telephony: Few PIN/PUK fixes

Following changes have been made as part of this:
-> 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.
-> 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.
-> Display the complete text including attempts remaining to
   unlock PIN on SimUnlockScreen if user entered incorrect PIN.
   On some devices the display text is ellipsized when trying to
   display on a single line.

Change-Id: I73718c9e6a8aa7244097e0dd4593a6226ff0ac08
CRs-Fixed: 184479, 260481, 181402, 181380, 181401, 326286, 441001,
479414, 479417
(cherry picked from commit 1cfe4cb95d29b792e40c6a89cf2fdb1a0b8371e7)
(cherry picked from commit a50adebc939f1ff6cb9633ba116f4e7d1ffe60e3)
(cherry picked from commit e29e99706ad4e8ddc06f157a9a56e5dcaf0e49e7)
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 config item for regular deactivation

- Default AOSP implementation is to restart the radio for PDP
error cause = 36-Regular deactivation.
- Add xml based option to disable this implementation and treat
error=36 as temp failure.

Change-Id: Ic7c05231a08d027280c8e46f7662b78163fdb69f
Add config to send SMS on 1x

When UE is attached to eHRPD network, IMS is registered and
there is an active 1xRTT voice call, the config determines
whether to send SMS over 1x. Default value is true

Change-Id: Ie4e00eb57ef439e9383c616cd1b60108bcfd505f
CRs-Fixed: 565247
Mms: Add configuration for sending and receiving Mms with data disabled

Use framework resource to config the feature that sending and receiving
Mms when data disabled.

Change-Id: I96362a66aea228afd3033cdf9343468a6d3ffa83

Conflicts:

	core/res/res/values/symbols.xml
Telephony: Add 7bit Ascii support for long messages

Add config item for 7bit Ascii encoding and decoding
support for long messages

Change-Id: I54080a5c63fd2dc470f38edeffbe58729c22adf9
Telephony (MSIM): Change the code to use @bool/kg_use_all_caps.

Change the to use value from resources @bool/kg_use_all_caps
in MSimCarrierText class to be in line with base class.

Change-Id: I40bf386e867ff6b061008881fa125763b989776c
CRs-Fixed: 587508
telephony: Cleanup after QCRIL merge

Change-Id: I777818d9034593696bf96ad96048daa0011e9f80
MSIM: Fix for 3G symbol not displayed on T+G issue

On a DSDS Tdscdma+Gsm device, when DDS is set to Tdscdma sub,
3G symbol is not getting displayed.
Add code changes to update data icon to 3G for TD_SCDMA network type.

Change-Id: I3efdf1cc474e5b2316757de79200fc59ba196f52
CRs-Fixed: 546652
Telephony(MSIM): Increase the size of cancel button.

The "cancel" button is too small in the enter SIM PIN
interface. Increase the size of cancel button to
make it usable.

Change-Id: Ibc7b327723f2afa75119f6ece190edbaa71fbd0a
CRs-Fixed: 542539