telephony: reconcile Sony RIL with QualcommShared

Change-Id: Iec8013ebce671ab126efd3228de2c9b76583ccc6
PackageManager: Restrict system packages to protected storage

Don't allow packages signed with the platform key to be
installed into user (or app) controlled storage

(cherry-picked from 64fa8092090d067d78163b8ebce45baa1123ce9d
 with changed file path)

Patch set 2: Fix compile error due to changed function name

Change-Id: I7390b3bdf5289411f7a335c69635bed9f74bbfb3
ril: avoid sending null aid string in getIMSI

A change to how getIMSI works in JB causes null aid strings
to be sent.  The result for RILs older than v7 is a corrupt
ril response in SIMRecords::fetchSimRecords.  This corruption
ends up setting mImsi to null (in SIMRecords) and that causes
havoc w/ 3g/4g data connections.

This patch avoids sending null aid strings and has fixed
data connection issues on several Motorola devices.

This new patch is implemented as an opt-in old ril feature

Change-Id: I6682ea10c8b216e2adc5abffbcc50f3cb6c9d7b8
Debug RILJ wakelocks on Smdk4210Ril:

Original author's commit message:
------------------------------------
There is a battery drain due to a wakelock being held for an unspecified
length of time. BetterBatteryStats shows it to be RILJ holding the wakelock.
I've narrowed it down to a RIL request named RIL_REQUEST_SET_TTY_MODE. I
dumped out RILJ.mRequestsList during the held wakelock and I see this request
staying around and waiting for a response from the RIL. It's as if the RIL
is not responding to this request and I don't see RILReceiver processing a
response to this request.

One thing to note is that RIL_REQUEST_SET_TTY_MODE is generated when we see
EVENT_TTY_PREFERRED_MODE_CHANGED from PhoneApp. This happens when the phone
boots up and also when you plug in a pair of headphones. Thus this wakelock
can be reproduced by plugging in a pair of headphones.

To work around this, I've added logic to perform a lazy removal of RILRequests
that haven't received a response in the existing wake lock timeout
(60 seconds.)  The removal itself is done as part of
findAndRemoveRequestFromList().  Since new RIL requests are appended to this
list, we're guaranteed that the stale TTY requests will eventually be removed
either when the existing timeout fires, or through this new lazy removal
------------------------------------
Additional comments from Andrew Dodd:

There seem to be all sorts of things that can cause similar behavior.

Rather than purge requests known to have issues, we just print them
so we can fix root cause.

Change-Id: I0a80ba8fb5a1811ab1d8f78e3b8d1bcbfc627377
Smdk4210RIL: block unsupported requests to avoid RIL wakelocks

Change-Id: I7abd83e33284268da7aaf8ab3da9cb04a381720d
VPN Traffic Amount in Human Readable Format

Normally, VPN traffic amounts are registered in the amount of
bytes that have been transferred over the VPN link.  But that's
ugly, ugly for humans that is.  Most of the time people like
Kilobytes, Megabytes, and Gigabytes; not ugly Bytes.  This
modification changes that so that you get a nice way of
describing the amount of data that has been transferred over
that VPN link.

Signed-off-by: Tom Parkison <thomas.parkison@gmail.com>
Change-Id: I3cef28d63cd98aad833a9d1c9262b162e78a11ab
SmsUsageMonitor: Increase default # of sms sent in checking period

Credit: rholland80 :: TeamBAMF

Signed-off-by: BMc08GT <bmc08gt.teamb00sted@gmail.com>
webkit: Fix black video frame during video src change in fullscreen mode

- Create HTML5VideoFullscreen singleton class to support seamless video
  src switch in fullscreen mode
- Extend the custom view callback interface via AnimatedCustomViewCallback
- Introduce SurfaceTexture states in HTML5VideoView to manage the
  dynamic changing of the SurfaceTexture consumer
- Add new player state detached to notify native MediaPlayer when
  SurfaceTexture is detached from inline mode
- Pause the video when exiting fullscreen view

CRs-Fixed: 389696
CRs-Fixed: 389639
CRs-Fixed: 398029

(cherry picked from commit 4f9aeb952f164b1104be060d347307f15e0c4829)

Change-Id: If0a56a28217fe837d5e2291aa70f8ff88bccb22b
framework/base: support for camcorder timelapse recording

This change addresses timelapse based recording from
camcorder app for resolutions other than default
video resolutions.

Change-Id: I08d4acff3ee6e2b8e31449ef0b34dc7ac65db054
CRs-Fixed: 391159
Change the thread priority

Change-Id: Ieece4851132ff85e36d10874991793cc4c0714ca
Postpone sending scroll message to webcore thread

Post a message to the UI thread instead, to send the
scroll message later.

Change-Id: Iff94af37e9070e63e0797195c7588343ab077bb3
ActionBar: Compute required items prior to optional items

When computing if a item should be shown in the action bar, required items need to be compute prior
to optional ones. Otherwise, in some cases (when the optional menu goes to the left of required
items then the algorithm could determine that optional has space to be shown and force the show of
required items, causing the required items to not be shown).
A concrete case is in the Email app. In the message_view_fragment_option.xml are defined 5 menus,
that when are all shown (xe: in Exchange mailbox account type) the bar is complete filled. But if
the overflow button is forced to be shown (the device has no permanent menu key) the overflow button
overlaps the older button, because space of 'ifRoom' items are wrong computed.

Discussion Change: http://review.cyanogenmod.com/#/c/22396/

+ aosp change https://android-review.googlesource.com/#/c/34700/
Prevent empty overflow popup when there are no overflow items. (jakewharton@gmail.com)

Change-Id: I6fc8e3e202d76f9704d7ec2383c7ee6f7b05ba76
Move voip/java/com/android/server/sip to framework2.jar

The method cap that neccessitated framework2.jar is getting quite close
to being full again. These classes can be moved safely and relieves some of
the pressure. Found by ninno_mx.
Fixed: Removed undesired changes, sorry.
Change-Id: I91c65d8efbd7fa68b77714f3892c9be184b4f3bf
telephony: let us write just the aid on getIMSIForApp

This implements a new RIL compatibility feature, "writeaidonly", that
lets us write just the aid, without the preceding 1. This is needed to
be able to read the IMSI correctly on some Motorola RILs

Change-Id: I48e9d76db6730571c01d59313fc7a5e79845f922
DockAudio: Always route audio back to normal on undock.

Only ignore dock event when docking, not undocking.

Previously for Samsung devices that utilize the extra setting to enable
the dock audio, if the device setting is disabled while on the dock, audio
is prevented from routing back to the device speaker after undocking.

Change-Id: Ib182751a29bf7ba8feb9ff153cd3708df80f7ee6
Accurately display connectivity info in tablet status bar

Currently, if the connected network is something other than a Wi-Fi
network or a mobile network, the status bar popup would display
"No Internet Connection" which is misleading.

Patched wifiLabel (which is only used here anyway) to also allow
other connectivity (bluetooth, ethernet) to display correctly.

Before: http://imgur.com/YMB2C
After: http://imgur.com/kFt3Q

Change-Id: I2ac8d453e001c5ac14c0f2ebd97e1ef73551c37e
CatService: fix typo

Change-Id: Ic398555349bb2ae5fb7fe754fc48d69d391b2831
LocationManagerService: Respect the type of NetworkInfo that was passed

The location manager service which sends network info updates to the
gps location providers was changed to ignore the connectivity update's
type and just fetch the dominant network info, but this is a problem
since we want SUPL updates even if it's not the dominant network type.

This change makes it fetch the latest info about the network type for
which the update was actually intended.

Change-Id: Ic8e78482f584de3143a6b815361f6b6d49c498b5
Call to equals() comparing different types

I have found the bug with the FindBugs tool (http://findbugs.sourceforge.net)

Call to String.equals(android.content.ComponentName)
at ActivityManagerService.java [line 8874]
in method dumpActivitesLocked(..)

Change-Id: I99851de024b55b53f1b206f0645b6fe29f865784
NullPointerException in UsbStorageActivity and SQLiteSession

FindBugs description:

Null pointer dereference
A null pointer is dereferenced here. 
This will lead to a NullPointerException when the code is executed.

Bug kind and pattern: NP - NP_ALWAYS_NULL

Change-Id: I292a29058de1828f376564188a2e00c61ea194b0