Telephony: Allow setDefaultDataSubId to be called multiple times

- Allow setDefaultDataSubId() to be called on same subscription
multiple times without causing PS DETACH on that sub.
- Call setDefaultDataSubid() after bootup.
- Inform OemHookDdsService about default DDS even during on-demand
PS attach requests.

Conflicts:
        src/java/com/android/internal/telephony/dataconnection/DctController.java

Change-Id: I7e40998e1ff239e2cd6360568d217b801a475da9
MSIM(Telephony):Add changes to SMS APIs as per new SmsManager design

Changed SMS Msim APIs as per new SmsManager design.

Add change to fix for copying MO/MT SMS of SUB2 to its
SIM memory correctly in C+G mode, by calling current Phonetype based
on subscription

Change-Id: Iaee8b93ef373e34ddcc5b7d65365852e470467d4
Store Network Mode selected in subId Table.

Store the user prefered network mode for a sub
in simInfo table so that on subsequent bootups user
preference is retreived and same is set for that sub.

Change-Id: I6d06c0cee19b2396406a09442eb10e6aef16c6c8
MSIM: Trigger DDS during card removals and sub deactivate

- When card removed(hotswap), trigger DDS switch
  on next available sub.
- Modify the code logic to not trigger DDS
  request multiple times when user deactivate
  subscription from UI.
- Add fix to send data allow request when device
  powered-up first time.
- Add few log statements.

Change-Id: Ib93a60f7d575373b11a38f65e021e6f0ce77075d
Fix to change preferred network mode.

Allow setting preferred network mode without depending on modem capabiltiy.

Change-Id: Ida0012a443baa415707898c0927093a8775bc3bb
CRs-Fixed: 739300
Telephony: Get SIM card capacity count of SMS.

Add one API:
- getSmsCapacityOnIcc: get the capacity of stored SMS on ICC card.

Change-Id: I63c1431cf02db2dbdee3553afc2448b4ec2cdfa3
CRs-Fixed: 645022
Fix the issue - Unable to add second VT call when first call is active

- Cache the video state of the new pending call when the foreground
  call is HOLDING.

- Use the cached video state when dialing the pending MO call or
  accepting the pending MT call after the first call is put on HOLD.

Change-Id: I761dcc1e9b8383ea2eb39500873dfa38401268bf
CRs-Fixed: 743214, 741286
Fix for data and roaming icons

- 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

Change-Id: I915421a6f5906d80ed5b8dd9c433115ad5df1f14
CRs-Fixed: 285986, 303275, 326204, 326634, 333008, 339297
SRVCC: Add support for incoming call SRVCC

Transfer connections from ringing call to handover call on getting
Handover Complete notification. This allows for accept to be done
on the default phone instead of IMS phone after SRVCC. Set the
state of ImsPhoneCall object to Idle after the transfer.

Change-Id: I09cfcc9fc99b3ea4b3a4bd332af546bcfae4b679
CRs-Fixed: 737743
Telephony: Keep RADIO state off in APM for iwlan RAT.

- Due to polling in APM the current service state gets changed
from OFF to OOS which is incorrect.
- Let the radio state be in OFF state and added additional checks
to allow non-default PDP activation if current RAT is iwlan.

Change-Id: I3f62b225fa2345a278858560a44ccd6ab1a9e32a
MSIM: Fix ECBM dialog issue in G+C

Fix ECBM dialog issue by setting ECM mode property value
 as single SIM instead of comma separation in MSIM.

Change-Id: I7bb3c169dc0e0216afbf773236e4d08fda33a0c0
CRs-Fixed: 732984
Telephony: Fix the failure of copying SMS to SIM card for sub2.

While copying SMS of sub2 to its SIM memory, in process of getting
current Phonetype will return default sub's(i.e,sub1's)Phonetype.
But we want to get sub2's Phonetype here.

To fix this, get current Phonetype based on subscription id.

Change-Id: Id554430378ae0837d5eba2d2029ead147b8c3e83
CRs-Fixed: 727110
telephony: Apply regional spn rule

Change-Id: I7ae28472812aa26b80ae3fd7ec5f4a3a5584c132
Add support for sending and receiving mms when mobile data is off. Fix crash during data setup error with null fail cause value.

1. Can not set up mms apn while mobile data is turned off, so it will fail
to connect when use mms connectivity in app.
Even if mobile data is turned off, we also allow set up mms data when
use mms connectivity.
2. Assign DcFailCause.UNKNOWN to fail cause if a null value is received
from DataConnection.

CRs-Fixed: 532101, 600935
Change-Id: I32eac49bec9687052ddbb5ad89da5efc478326df
Telephony: Don't validate status field.

- status field is also being used to update the intermediate downloading status
to update the UI accordingly.
- these intermediate values exceed the spec defined valid range.

Change-Id: I853983d186c3c79b4bbec459d017f0dd4298af5d
Fix Mms issues on Cdma

For apn with empty apn name, Mms app will query
for mms info matching apns in telephony db.
Set apn name to empty string for Omh profiles

Change-Id: I256964750bf763848591314b208b7e823e538682
CRs-Fixed: 731752
Cleanup the StateMachine thread during RilMessageDecoder dispose.

Currently the dispose() method in RilMessageDecoder wont stop the
state machine thread, and each time a new state Machine thread is
created which causes the file descriptor leakage.

Add quitNow() method  in dispose() of RilMessageDecoder to stop the
state machine thread.

Change-Id: I83f773adf7f5fc0b82abf912f2db7fec8a0aa87b
CRs-Fixed: 725656
Set Network Selection Mode to Automatic after flex mapping.

Set the Network Selection Mode to Automatic on all subs
after flex mapping because if network selection mode is
manual on any of the sub it will be in Limited service after
flex mapping...

Change-Id: Ica0d71e154963a08702c3d62c869b7efd1d5e25e
CRs-Fixed: 726384
Telephony: Consider dataRegState to determine SPN display

There may be situations where voice service state is OOS and data
service state is IN_SERVICE. In such cases, both regStates need to be
considered to determine what to show in UI for SPN.

Change-Id: Iab17ed07611b6fd95d6bc6ee3e2e095f6700e3ba
CRs-Fixed: 532471
Ims: Add support for WIFI network mode notifications

Added support for enabling and disabling features for Voice and
Video when network mode is WIFI or IWLAN

Change-Id: I27f2ba28077bc3eecc97d376cb0b4799ef7da54b
CRs-Fixed: 743490