telephony : update stk functionality for samsung phones ported from CM9

Description: This update enables sms based stk Apps(Mobile identinty, mobile banking,...) on Samsung phones

* moved CatService.getInstance() from IccCard to GSMPhone and CDMAPhone,
we need to pass iccSmsInterface on CatService startup for sending sms.

Change-Id: I32c89b823cecae711b93a0f6717b9bdb39e9ab7e
frameworks/base: Add support for QCELP/EVRC formats

Change-Id: I82e4e2c23e6ed3e2421fe54ff8bd4f848768b8c6
ActivityThread: Avoid creating duplicate handlers and reuse mH

sMainThreadHandler is used for notification of changes in
SharedPreferences and refers to a new instance of Handler instead
of the existing instance, mH, of the ActivityThread. Fix to reuse
existing handlers associated with main looper.

Change-Id: I794a5802a9eacdb188bd0619db5e70e3ae89a07d
StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test.

Issue description:
When run ICS stress test, always meet GREF issue. one of contributor is MountService$MountServiceBinderListener.
log info
19:21:11.609   222 24316 W dalvikvm:        24 of com.android.server.am.ActivityManagerService$AppDeathRecipient (24 unique instances)
19:21:11.609   222 24316 W dalvikvm:       479 of com.android.server.MountService$MountServiceBinderListener (479 unique instances)
19:21:11.619   222 24316 W dalvikvm:         7 of com.android.server.accessibility.AccessibilityManagerService$6 (7 unique instances)
Note: PID 222 is system server.

Issue alaysis:
Everyone can call getSystemService(Context.STORAGE_SERVICE) to get service.
When other service get StorageManager, StorageManager will new MountServiceBinderLister and
register a listener in MountService, which won't be unregistered. It's easy to generate a lot of
instance of unused MountService$MountServiceBinderListener in system server.

Issue fix:
So change the policy to be:
1. Doesn't new MountServiceBinderLister in construction.
2. when other service needs to register listener in StorageManager,
StorageManager will register listener with MountService.
3. When other service needs to unregister listener in StorageManager,
if there is no more other listeners in StorageManager, StorageManager
will unregister listener in MountService.

Change-Id: Iaaf889f44a1a5f62b9f65b3ab1b486c9b7dcaf7f
Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare  <bruce.j.beare@intel.com>
Fix SurfaceView notifies on invalid surfaces.

SurfaceView notifies registered callbacks on invalid
Surfaces.

Change-Id: Iddc9a5cd073fb73a0e7e9b9ca64ff4fac0777ca7
Return early when checking divider before child zero.

Previously the `getChildAt` method would be called with an index of -1 which
would lead to an exception being thrown and caught. This is unnecessary since
we know there will never be a divider before the first child. It also avoids
additional object creation since this method can be invoked quite frequently.

Change-Id: Iab44520d5d52f96a829a009cdd1201696edbf9a4
Telephony: Add HSPAP to getTcpBufferSizesPropName

When device is camped on HSPAP TCP Buffer sizes need to be configured
properly to support higher data rates. Without this change, default TCP
buffer sizes will be used and throughput will be low.

Change-Id: Ica5884b35851a32e57c82c63b148df5be580ae83
Bring back down arrow (when IME is showing) in nav bar.

Change-Id: Id3a55ffe16b5b122ca054986bfcccb7a7cf2964b
Configurable 0, 90, 180 and 270 degree rotation (framework part)

This is similar to my previous CM contributions. Requires settings
UI to configure (not done yet). The rationale is to be able to
have automatic rotation always enabled, but only for desired
angles.

Original-https://github.com/AOKP/frameworks_base/commit/ec06ed7f2a362581d202c034f6b9a9172b906508

Change-Id: I7e30e78f69e36794fa13724fe45e67e897f0ad80

Conflicts:

	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Add ability to unlink notification volume from ringtone volume (1/2)

Original code by romanbb from ICS

PS2: use getBoolean

Change-Id: I8276e299cbc0c5b4cbad986f06c89fec4dcf2730
Poll for DATA_REGISTRATION_STATE on SVDO devices (3G icon fix).

When both voice and data are active, SVDO devices return
RADIO_TECHNOLOGY_1xRTT for VOICE_REGISTRATION_STATE, and
RADIO_TECHNOLOGY_EVDO_A (or equivalent) for DATA_REGISTRATION_STATE.  So
both states must be polled to determine "which" radio technology is in use
(although they technically both are).  Otherwise only 1xRTT is reported.

Note: This bug was masked for a while as the PREFERRED_NETWORK_MODE
defaults to NETWORK_MODE_GLOBAL in PhoneFactory, which is another,
preexisting circumstance for polling DATA_REGISTRATION_STATE.  Thus, the
bug would trigger upon opening "Mobile network setings", when the radio is
queried for its PREFERRED_NETWORK_TYPE the first time.

Change-Id: I80456a7a1f2136a2ee68b54137dbafd4db8e202b
Telephony: Initialize RIL with the correct CDMA subscription mode setting

Users choice of CDMA Subscription Source is stored in CDMA_SUBSCRIPTION_MODE
setting in database.
If telephony restarts after a crash, PhoneFactory sets the
CDMA subscription source value from PREFERRED_CDMA_SUBSCRIPTION
setting and that causes the mismatch with the value in the settings
database chosen by the user. The change is to use the
CDMA_SUBSCRIPTION_MODE setting instead when creating the RIL object.

Also, remove the Setting PREFERRED_CDMA_SUBSCRIPTION from the database.
With this change the special treatment for LTE on CDMA will not be needed.
The correct value can be set in the database for CDMA_SUBSCRIPTION_MODE
and that will be taken on power-up by this code.

Change-Id: I80edd1be0673332823fa690f119f7fb427b756d7
Support NT_MODE_LTE_CDMA_EVDO for LTE toggle (1/2)

Change-Id: I40408853bea4528d147d4e6a7c56ec6c97b3cb35