Fix OOBE crash/DoS after receiving 0-byte WAP push.

Add a try/catch block around the code in WapPushOverSms.dispatchWapPdu(),
so we don't get into a reboot trap on receiving weirdly formed messages.
Only catch ArrayIndexOutOfBoundsException, which is difficult to
prevent inside dispatchWapPdu() for 0-byte PDUs or other unusual
contents. The caller should probably catch any unhandled exceptions of other types and log them with stack traces.

Bug: 11967705
Change-Id: Iabfec68d2564dd438d45c80cdba877bf19fa0397
Telephony: Samsung STK Support

Squashed Commits of the following:

    Add Samsung STK support (telephony part)

    Support for SMS-based SIM applications.
    Partially rewritten the original patch by Jüri Schultz to be less intrusive.

    Change-Id: I15d2de1781a2823e24941dd792db3d372578aa9f

    Samsung STK: Add USSD support

    Allow USSD-based STK applications to work

    Change-Id: I483f37a44a6c3ed43eefcf979e17b84877d03f93

    Samsung STK: Fix SMS-based STK

    SEND_SMS was falling through to SEND_USSD (which used to do nothing
    until USSD support was added) causing an Exception because cmdParams
    is not an instance of SendUSSDParams.

    Fix by using type-checking instead of checking if Samsung STK is
    enabled (because SendSMSParams and SendUSSDParams will only be
    created if Samsung STK is enabled.)

    Change-Id: I671014e295e9e529aad25a8b6fbd5a2e5788fc44

Change-Id: I67866c9db4d5e5b42d8aa8d465d931f74c67e308
PhoneFactory: fall back to default RIL if custom RIL Class fails

If the ro.telephony.ril_class property is set to an invalid class it will cause
Phone to repeatedly FC and make the device unuseable. This allows it to handle the
exceptions gracefully and fall back on the default RIL.

Change-Id: Ic9c309aff173de5267aa7ef633bfff87243f24fd
Merge "Telephony: Samsung STK Support" into android-4.4
Fix enabling data connection

Could not enable the default type APN in below case:
1. Default apn exists, connect wifi
2. Delete default apn
3. Disconnect wifi

enableApnType won't reactivate default apn type when no
default apn exists. Add default apn criterium to avoid this.

Change-Id: Ic8699669e576e5d2140852f359e34ed6c3275633
SamsungCDMAv6RIL: update to latest RIL

Also add two mic state and WB AMR

Change-Id: I0a9fdbbfa7880f964c530b7aa3e46baf2fe9e6c1
Don't assume 3GPP as active app on CDMA with LTE device

IccCardProxy assumes, that on a CDMA+LTE device, the active app
is the SIM/USIM and not the RUIM/CSIM. However, for voice RUIM/CSIM
is the active app on such a device. All services, like FDN,etc. should
be tied to the active voice app.
CRs-Fixed: 428304, 506938

Change-Id: I70894a1aab0a812a50f1cbab986161bb3b708b85
(cherry picked from commit 4d19143c3cf2ea1ee37fa1c05cac984ab14ce603)
(cherry picked from commit c623954a27891a0693bf2208bb095183f1d1b9d9)
(cherry picked from commit e48c977e219b4afba93eb71ac0c4e937f3376710)
(cherry picked from commit 76eab3d4d4b2e6e57048b229b132525c1fd80e3a)
cdma: Restore SVDO after merge.

Allow evdo/ehrpd + voice simutaneously.
Use ro.ril.svdo=true

Change-Id: If7be25edc10f21680adbe3a059370d77a82ef076
(cherry picked from commit a28dfbec287a2e546d1bfcc1f958922daa04822c)
Revert "cdma: Restore SVDO after merge."

This reverts commit 939f35d2373d2434bca369f3c28b9a53025e91cf.

Change-Id: I59a6510750a83dcfd448a3f96537a90d71d2b5b7
Merge "SamsungCDMAv6RIL: update to latest RIL" into android-4.4
Revert "Revert "cdma: Restore SVDO after merge.""

This reverts commit 169ac23c643ca01bc6bf15602af6fe9e670a0b37.

Change-Id: I82771a04ea8f08161b586ff7779e06c7bb37b853
Merge "Revert "Revert "cdma: Restore SVDO after merge.""" into android-4.4
Revert "Revert "Revert "cdma: Restore SVDO after merge."""

This reverts commit 432afb91570669968eb9b4f4a8f9d945ea7f1f7f.

Change-Id: I10486fd185d999869dcc911031cf11b065b93390
Merge "Revert "Revert "Revert "cdma: Restore SVDO after merge."""" into android-4.4
Merge "Don't assume 3GPP as active app on CDMA with LTE device" into android-4.4
DCTracker: Squashed commits to fix CDMA Data

Use dummy profiles if buildWaitingApns can't find valid APNs

Requires: https://gerrit.omnirom.org/#/c/4195/

Change-Id: I706767200fa4a061a8f2e18796c878e506527102

Fix cdma data calls based on NV

For NV data calls we need to create dummy profiles
When DcTracker switches from lte to cdma we need to bring
down existing data call and establish new one (same goes
for switching cdma->lte)

Bug: 10804691
(cherry picked from commit 4ead798ed4964952c3086b3224d775479d66d240)
(cherry picked from commit f333f0ca7b1c992ab36af83ca74a1131d3ae17b8)
(cherry picked from commit 14e5657432de2eb9ba52ebf28a8967ed62ee4a0b)
(cherry picked from commit ff99b7392eccef8a848d49fdc46a3a5f1afecd56)

Change-Id: I7ad8d0632854ea9875afb76709c1ba894bf048fd

Create cdma dummy profiles

Create cdma dummy profiles if none are found in database

(cherry picked from commit fd636d72606d9f34ffbbe0e8d7aa1e238dbb3f85)
(cherry picked from commit 4c1b138e89e200cb5a2b4e6e640f162bad2d9b36)
(cherry picked from commit 37ad63426059d621d7d6ad5c3ea5901aa937a608)
(cherry picked from commit e085e00824a570942a2f47a9b3474f5a03f37e53)

Change-Id: I2b1fcc349b0734f67c59fc7d1bca96ee7164461b

Change-Id: I7ad8d0632854ea9875afb76709c1ba894bf048fd
Revert "Revert "Revert "Revert "cdma: Restore SVDO after merge.""""

This reverts commit d5dc27d60e5770c763dee7940fa94ddec190e159.

Change-Id: I91d9b18506866a2b53482fe5efa4f80a3473ce1d
Merge "Revert "Revert "Revert "Revert "cdma: Restore SVDO after merge.""""" into android-4.4
Merge "DCTracker: Squashed commits to fix CDMA Data" into android-4.4
fix for Samsung CDMA incoming SMS bug

ported from CM7/9/10/11

Change-Id: I6189dd0c6aeffb0b8b530bab7994a07bb390c32c