DataConnection should not retry permanent errors.

Update DcFailCause with the "no retry" info from ril.h

Bug: 9040015
Change-Id: Ib94af9996c79800322251a45349b117e1f913269
Restart, cleanup or retry inactve connections.

Instead of retrying all inactive connections, restart radio on very bad
errors, clean those that are permanent failures and retry
the others.

Bug: 10131736
Change-Id: I2527b18d6cda52c55fb94be58fbb1a7a86818ef9
Add mEnableFailFastRefCounter.

Use a reference counter to control enabling fail fast
as there are now two entities which control failing fast:
ConnectifityService.checkProvisioningUrl and
MobileDataStateTracker.captivePortalCheckComplete.

Bug: 9462512
Change-Id: I0dea0eee519f8ee7f94e79d40e82c18f30d7fe2e
SamsungExynos3RIL: Handle UNSOL_DATA_CALL_LIST_CHANGED.

Change-Id: I0bc346b9c15a2cf10bb3f982b8bf48c71d52196a
Telephony: Mock SMS (2/4)

This change brings the possibility of simulate the reception of SMS on real devices.
This change adds a MockSmsReceiver inside SMSDispatcher that have a BroadcastReceiver listening
for Intents.MOCK_SMS_RECEIVED_ACTION actions. This class accept the SMS simulation if and only if
Settings.Secure.ALLOW_MOCK_SMS is enabled and the sender application has the
"android.permission.SEND_MOCK_SMS" permission.

This receiver should be used in the next way:

Devs should declare <uses-permission android:name="android.permission.SEND_MOCK_SMS" />
and call it with:

Intent in = new Intent(Intents.MOCK_SMS_RECEIVED_ACTION);
in.putExtra("scAddr", "+01123456789");
in.putExtra("senderAddr", "+01123456789");
in.putExtra("msg", "This is a mock SMS message.");
sendBroadcast(in);

or

String pdu = "07914151551512f2040B916105551511f100006060605130308A04D4F29C0E";
byte[][] pdus = new byte[1][];
pdus[0] = HexDump.hexStringToByteArray(pdu);
Intent in = new Intent(Intents.MOCK_SMS_RECEIVED_ACTION);
intent.putExtra("pdus", pdus);
sendBroadcast(in);

Ported from http://review.cyanogenmod.org/#/c/23017

Patchset 2: Add support for sender vanish address; Split request into multiples sms
Patchset 3: Remove TODO comment

Change-Id: I14cab3d8ceb484df71a676dcfa44ca1634be908d
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Merge "Telephony: Mock SMS (2/4)" into cm-10.2
fix mvno_match_data OutOfBounds Exception in substring check routine.

When the length of mvno_match_data is greater than GID from IccRecord,
It will generate StringIndexOutOfBoundsException.
Therefore, codes are changed to use startsWith() insteads of subString().

Change-Id: I04c5c5039edb2cfa757bf2f5a4b9f124afb69b06
Bugs: 10171336

Fix mvnoMatches function but keep case-insensitive

Redo previous fix in a way that's still case insensitive.

bug:10171336
Change-Id: I65e29b72ace2a41ed7a19e3bfb5d23bf3773d41c
Telephony: Fix Mms auto-retrieval

This adds some missing code from the 10.1 port

Change-Id: I57093d0dfbc00478b2835324e740da9d75c111d6
DcTracker: Only retrieve records when we're either RUIM or CdmaLte AND subscribing from NV

Change-Id: I498097440d62ad6c9e04497085a63ede894fb5d8
Make EnableFailFastRefCounter a singleton.

Since there is only one DCT the mEnableFailFastRefCounter can be a
static/singleton and thus properly refcount the
CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA. There is still one problem
and that is if the PhoneApp crashes the singleton will be reinstantiated
and we'll have the same problem, but the frequency of this is small.
Also, the consequence of this is the DCT will be behaving "normally"
in that it will be attempting to do data-stall recovery although we
might like it not to it is the "normal" behavior.

Bug: 10304904
Change-Id: I4197c4236a402aa247f775e480e747620fd189bd
Add support for a provisioning apn.

When there is a provisioning apn, such as lwaactivate from AT&T it is
not necessary nor desireble to try to make network connections as
they will be no TCP ACK's to SYN messages, except for a limited set
of operator white listed addresses.

This is implemented by adding two commands CMD_IS_PRVISIONING_APN
and CMD_ENABLE_MOBILE_PROVISIONING. These are used by ConnectivityService
CheckMp and to know when we are connected to a provisioning apn and to
turn actually bring up the connection when the user needs to provision.

Also, incorporate the sEnableFailFastRefCounter change from klp to make
a singleton and remove the RuntimeException.

Bug: 10328264
Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
PhoneProxy: Update IccCardProxy only when cdma voice tech changes.

	Update IccCardProxy only when the device is reporting new cdma voice tech.
	Fixes scenario where device reports UNSOL_VOICE_TECH_CHANGE to UMTS, but remains
        as a CdmaLtePhone.

Change-Id: I81bd5d3c6cf553c0a60ad3d4f1f581d3500f446c
Merge "DcTracker: Only retrieve records when we're either RUIM or CdmaLte AND subscribing from NV" into cm-10.2
Merge "PhoneProxy: Update IccCardProxy only when cdma voice tech changes." into cm-10.2
PhoneProxy: Restore previous updatePhoneObject logic.

	No reason to do an opt-in with a boolean, most cdma devices with >= v6 RIL should be
	able to update their IccCardProxy when triggered by an EVENT_ICC_CHANGED
	message.

Change-Id: Ica92c2d53e9d3551d3abe8b460b80d0d381ac5bb
HTCQualcommRIL: Handle HTC VOICE_RADIO_TECH_CHANGED response

* Properly handle VOICE_RADIO_TECH_CHANGED unsolicited response.

Change-Id: Id42deb43237be78286a20dfb22e4645c6b83ceed
HTCQualcommRIL: properly reset radio on RIL_CONNECTED

* Resets radio on RIL_CONNECTED, but only after the first RIL_CONNECTED
  response.

Change-Id: I94a56d97eca173b8bcc5b38e59ee43740d2ef74a
HTCQualcommRIL: correct handling of CDMA + LTE quirk.

The current handling of this quirk just forces a specific
network mode. This breaksGSM mode and network selection on
boot for devices using this flag. To correct this, get the
value from Settings.Global object and set the default value
to CDMA + LTE mode for first boot.

Change-Id: I767d25e96b9cbbdddc486ce696eb95ff14dccb89
HTCQualcommRIL: support DATA_NETWORK_STATE_CHANGED_M7/5757

* This UNSOL response behaves the same as the existing
  RESPONSE_DATA_NETWORK_STATE_CHANGED message.

Change-Id: I804c1f13fb3019a7e54a344967a3a4eb707046fd
Merge "PhoneProxy: Restore previous updatePhoneObject logic." into cm-10.2