SamsungQcomCDMARIL: Add support for SIM.

Change-Id: I3194c30f36eb6436c7f77883224376386d9bd9a6
SamsungQualcommCDMARIL : fix cdma/lte signal strength implimentation

From
James Roberts		Dec 10

SignalStrength.java seems to expect 99 in response[7] in 3g, and now lte rsrp is handled directly there now. What seems to work both ways (on d2vzw at least) is:

if (response[7] == 99) {
// If LTE is not enabled, clear LTE results
// 8-11 must be -1 for cdma/evdo signal strength to be used (see
// frameworks/base/telephony/java/android/telephony/SignalStrength.java)
response[8] = -1;
response[9] = -1;
response[10] = -1;
response[11] = -1;
}

and then leave response[8] alone when response[7] != 99.

Also seems SignalStrength uses 0x7FFFFFFF for INVALID on 8, 9, 10, 11 when all values are not wanted instead of -1 but seems to work either way for me.

Sorry for the long comment. Didn't want to push up a patchset on someone else's commit in case this is wrong.

Test shows:

-104 dBm 36 asu -- LTE

-88 dBm 2 asu -- CDMA - eHRPD

Change-Id: I3c182041387a698e2928e04547989e87773ef9fa
telephony: CdmaServiceStateTracker: Get cdma sub. when ruim ready.

This code made the assumption that cdma subscription isn't needed
when on cdma + lte. QCOM devices need to get both to provision
propertly because some SIM records are missing.

This patch adds a system property ro.cdma.subscribe_on_ruim_ready
to specify that CDMA subscription should be requested using NV
once the SIM records have been read.

Change-Id: I3e989e9f75c08412bb5f19155beea52e7d9f3c43
Fix ringing audio focus handling.

Test case:
- enable increasing ringtone starting at volume 0
- start any music player
- get an incoming call

Previous behaviour:
When ringtone volume is increased from 0 to 1, music continues playing
even
though ring tone is playing as well.

New behaviour:
When ringtone starts, music is attenuated to make user aware of incoming
call. When ringtone volume is increased to 1, music stops playing.

Change-Id: Ifc32ea162d4527572be0574024116d10ee9bca66
Fixed FC on calling unregisterReceiver with non registered receiver arg.

Crash Log: http://pastebin.com/r0qSGvbb

Patchset 1: Fixed a tab.

Patchset 2: Fixed spacing.

Change-Id: Idd3a7d28d62a980e5d8841535b0c9b57ea6e6a01
SamsungCDMAQualcommRIL: add icc handler to run when radio on

Brings bits over from QualcommSharedRIL

This allows d2 with uim to set correct subscription source
instead of being set on NV on first boot.

Change-Id: Ib0a0c7f03bddd7f3eca36b3bad2989d9af6b6dee
d2ril: change readint offset of one

Change-Id: I83ba3096a7d29f87605bebc0f72fe46124c1ca06
Some changes added to compile and run with Java 6 and Java 7.

  - correction of errors with Javac 7:
    - creation of empty classes.

Change-Id: I339ce56273025e389bb0f1cb3cc8450eca62ee11
SMSDispatcher: Add option for sending pseudo-multipart SMSes

Serves as a workaround for devices that are otherwise unable to send
concatenated SMS messages on certain carrier networks, by providing the
option (enabled by the "telephony.sms.pseudo_multipart" property) to send
multipart messages as individual (not concatenated) messages.

For example, parts of Sprint's network hang on receipt of multipart SMSes
on devices (e.g., d2spr) that use the qcom SMSLock method in sending
multiple messages.  That is, the device waits for acknowledgment of the
first PDU before sending subsequent PDUs, while the network (incompatibly)
waits for subsequent PDUs before acknowledging the first.  While sending
the messages individually is suboptimal, it both works reliably and
matches stock ROM behavior.

Change-Id: I1da9d2320780d57b7b6881edb52fb9d7413332ec
Telephony: Start DataStallAlarm only on Data CONNECTED state

Telephony framework uses AlarmManager for recovery mechanism of data
stalled issue.
Framework configures the ELAPSED_REALTIME_WAKEUP alarm for every
6minutes irrespective of the data state. Due to this,quiet a few
wakeups are seen even when the device is not connected to Mobile
Data network.

Fix is to check the Data connection state before starting
this alarm.

Change-Id: I219bff9199e5ce70bbcd05c95d65731886215fe9
Author: Jeevaka Badrappan <jeevaka.badrappan@intel.com>
Signed-off-by: Jeevaka Badrappan <jeevaka.badrappan@intel.com>
Signed-off-by: Arun Ravindran <arun.ravindran@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28494
Telephony: Unregister from UiccController when disposed

Change-Id: I296d3f292a72d2f8181f866bd1de7637c8333c63
Make ringing audio focus handling work with 'Speed up audio on MT call'
flag enabled.

Change-Id: I53c26afdbf95d4cc13c7b39d7dcb21d15bbe9a2c
Fix restoring network mode preference on reboot

When a user sets the option to use only 2G networks (for GSM networks) or its
equivalent for CDMA networks, each reboot erases that setting. That forces
the user to re-select the same option after each boot.
This (very simple) patch fixes it.

Ported from CM9:
http://review.cyanogenmod.org/#/c/16245/

Change-Id: I7ec9e155fed9f57934d7a73936f2bf425c8297fe
SamsungExynos3RIL: don't send IccStatus notification on CDMA devices

This causes the RIL to send erroneous GET_SIM_STATUS events that are
of course failing as CDMA devices lack a SIM card. This is causing a
persistent wakelock and quickly draining the battery.

Change-Id: Ic94ff85b63b21b66d66a757127585806c41a3ffa
SamsungExynos4RIL: fix signal strength

Doesn't work with Gingerbread radios!

Since ICS, the modem sends the signal strength in the first 8 bits
and the number of bars as from bit 9.
For old radios the first 8 bits are always 99.

Change-Id: I67b31baf18cbce2dfa7e6f8b096caaae74cd7cd8
SamsungExynos4RIL: Allow signal strength to be handled for GB modems

For devices that have no modems that support the ICS signal strength handling, allow handling it the old way with the ro.ril.gbmodem system property.

Change-Id: I68270c5a4026b2c8f448125607ee47dd04249176
SamsungExynos3RIL: fix unable to swtich 2G/3G while connected to wifi

When connected to wifi, the actual mobile network is not connected
but mobile data is reported as enabled, causing the code to try
and disconnect, which never happens since it's not connected in the
first place. Fix by checking if the network is connected instead of
if it's enabled.

Change-Id: I291b739a26fbf6c10917f195f80ea5044b6da03c
SamsungExynos4RIL: provide a fallback solution if signalstrength is invalid

Change-Id: Ib533b15feb4f56c00f1ce3c7baff5e0e73255e6c
Reset data stall watch dog after doing recovery

Without resetting data stall watch dog, one data
stall will lead to radio reset if there is no
data traffic after doing recovery.

Change-Id: Icc7b1e7f160cd0c8910f7132d7c2fea0d29803e5
Signed-off-by: Bin Li <libin@marvell.com>
Telephony: Correct the typo in RIL.java

Change-Id: Ic4bcd054f14d7e4b702b924f799e4d1619b666e0