Support GSM AT commands for SMS over bluetooth (1/2)

Modifications required to support the older GSM "AT+" commands for SMS over
the bluetooth transport for use with car radios, etc.  This must piggy back
on the existing handsfree code as the spec uses that channel for the commands.
(2 parts: frameworks/base and packages/apps/Phone)

frameworks/base:
Additions to JNI and supporting framework code to allow sending of individual
characters and to receive the PDU stream - neither of which are CR terminated.

Patch-set 2: cleaned out trailing spaces and tabs

Signed-off-by: Gary D <garyd9@gmail.com>
Change-Id: I1bd62e17496b5fdbd2f545b50c925863eb2fda2c
Add hidable kill-all-button to recent switcher

Signed-off-by: Robin Morawetz <robin.morawetz@googlemail.com>
Telephony: Handle Data Call List

* Check call status before validating data call state
* Remove duplicates from the list of data calls
* Add RIL_UNSOL_DATA_NETWORK_STATE_CHANGED string to RIL

Change-Id: Iea75053cb8226ec15d2a2c11a73332e5ebe8c793
Telephony: Add DORMANT state to GSM data link activity

GsmDataConnectionTracker sets its activity flag to DORMANT and notifies
LinkActivity when RIL indicates that all its data calls are in
dormant state (i.e. active is set to 1 in UNSOL_DATA_CALL_LIST_CHANGED
message for all data calls)

CRs-Fixed: 332606
(cherry picked from commit 6b57c3b68d989d6b8f114c5f87dac6fc2c13a5f5)

Change-Id: I1d4b9fd24c4049a938d62f08b7720d47400ad7e1
Telephony: Optimizations on alarms used

* Use non wakeup alarms for data stall detection
* Stop data stall alarms during dormancy

CRs-Fixed: 334349
(cherry picked from commit 3512da1c22a8bdb82d633b93a6f2de608f1b4b08)

Change-Id: I2a7654d7cf888d63bf3862d33f126218c409ffd4
QualcommRIL: Update getDataState override

Verification of the dataCall.active status was added to the RIL super
class in change Iea75053cb8226ec15d2a2c11a73332e5ebe8c793, so we can
now fall back to it

Change-Id: Ib04057ec09549c0c79a4e4e1d89e2aa480e1890f
telephony: when building apn list, use preferred apn if it can handle requested type

GsmDataConnectionTracker::setupData() does not consult TelephonyProvider when it
picks an APN for mms. It just uses apnContext.getNextWaitingApn() which picks the
first one in the list. On AT&T it picks wap.cingular, which is wrong for LTE.

Since the data connection is made properly, setupData() stops scanning and never
tries the correct APN (pta). The result is sending of the mms just hangs.

This change causes GsmDataConnectionTracker::buildWaitingApns() to first try the
currently active APN if it can handle the type of APN being requested, then it
tried the preferred APN and then the rest of the APN's, in that order.

This fixes the MMS problem since the correct APN (pta) is chosen.

Change-Id: I076b88d42f59241cf468d678ad0e628d0f2d9e8d

Conflicts:

	telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
libstagefright: cleanup mk to match CodeAurora

Change-Id: I8091b8b6cc65a89fc7a56c16574ac3b87f50e5ed
stagefright avcenc: Switch tmp variables to use the right type, to avoid casting

This fixes building on platforms where int is smaller than
pointers, e.g. 64 bit platforms.

Change-Id: I3da0459bac10cbffd1db699bf4782fe926cd391f
stagefright avcenc: Use intptr_t for casting pointers to integers

This is used for doing integer arithmetic on the pointers, for
checking pointer alignment.

Change-Id: I7a7ff834dc631ac9cce90e46216f64645e1ae6e5
String on Toast notification does not aligned to center

If length of the string being showed on Toast is short (less than 8 chars),
it is aligned to left rather than to center.
Added attribute android:layout_gravity="center_horizontal" on the TextView where Toast's message are shown to fix issue.

Change-Id: I77669fd8a11d1ec8f6b082348eb818671ce158bb
Signed-off-by: Taeho Kim <jyte82@gmail.com>
surfaceflinger: Fix top-bottom UI composition with S3D.

-Fix the scissor computation for top and bottom frame in S3D.
-Fix the artifacts seen in top-bottom case by clearing the
 color buffer with scissor applied.

CRs-fixed: 346986
(cherry picked from commit 241b5b6b41fa4e1b2eca3565fd27b454a6aff262)

Change-Id: I8fb98007f67351009762c4494e260142b998ddb5
Add a new API on DRM Framework for streaming

In case of DRM streaming, decrypt session can start just after
receiving the header, and it doesn't need to wait for the entire
content. However, current API of DRM framework only accepts file
handle or URI. With this new API, DRM session can start
without waiting for the entire content.

Changes are made by SEMC and Sony.

Change-Id: I74375fe127df636067f1c300ea91654ba3d1aa3c
libmedia: Fix build with gcc 4.7

gcc 4.7 doesn't like the redefinition of n in the same
scope:
for(size_t n=...;;) {
  size_t n = 2; // <-- duplicate definition
}

Change-Id: Idfc2e768a0eb85a3dacccd3431b4ad44775432a4
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Conflicts:

	media/libmedia/MediaProfiles.cpp
libstagefright/matroska: Fix build with gcc 4.7

gcc 4.7 doesn't like the redefinition of i in the
same scope

Change-Id: Idf1b33af7041f0302f2f2562442a3e11ce9607d9
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

Conflicts:

	media/libstagefright/matroska/MatroskaExtractor.cpp
fix build ALOG->LOG
Merge branch 'aokp' of git@github.com:IceColdSandwich/android_frameworks_base.git into blackics_new