Monitor device storage directly in /data/data

The DeviceStorageMonitorService watches over /data, and when things get
full, starts deleting app cached files.  The app caches are actually
under /data/data, which on DINC is its own mount.  This means the
monitor did not notice when app cache grew too big, as it only saw the
size of /data proper.

This patch makes the monitor look at /data/data instead.  For DINC, this
means it can properly manage app cache, but it won't notice if the upper
/data partition is getting full.  That's not as common as /data/data
filling up though.  For the Samsung devices that mount a /datadata and
then symlink to /data/data, it should also work, as statfs dereferences
links first.  For all other devices with only /data, reading statfs on
/data/data still yields the total/free sizes of the /data partition.

(cherry picked from commit fc99763ade87f9943b2fbfb2e81fb3401998cd2d)

Change-Id: I85ed6486c1085c4de2f5a7e825709f01d8cc8cba
Allow mounting of multiple volumes via mass storage (framework part)

The volumes to mount is taken from storage_list.xml (allowMassStorage)
rather than ro.additionalmounts in CM7.

Hand ported from the following patches:

commit 0233209827d95221399b1fe0185f79863fc6bf26
Author: Tony Layher <layhertony@gmail.com>
Date:   Sun Jan 2 12:46:38 2011 -0500

    forward port of 93bb95929a0c017498625a87654b4d114fe17b96 to allow mounting and sharing of mulitple volumes to MountService.

    Change-Id: I9fa3994e6e7b85360b451f57c1cdd4df921bc035

(the second part of the above patch was not ported)

commit 678fadf517126c8468ef2d8dcaea9c9fce96035b
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Nov 7 13:38:58 2010 -0800

    MountService: Remount all volumes after USB disconnect

    If USB was removed while UMS was enabled, the MountService was only
    remounting the primary share.  Any other shares, like the HTC Inc's
    emmc, were left in limbo.  This patch now iterates over *all* shared
    volumes to remount after disconnect.

    Change-Id: Ie6fd49ad80ba6fa0e4e194a386549cac786b4bbe
    Signed-off-by: Josh Stone <cuviper@gmail.com>

commit b1da9ed003edcd10ccda56fdf087e8f1b0f77b2a
Author: Josh Stone <cuviper@gmail.com>
Date:   Sat Jan 22 12:03:53 2011 -0800

    MountService: Only notify PackageManager for true ASEC changes

    MountService can be dealing with multiple mounts (emmc, sdcard), but
    only the EXTERNAL_STORAGE has any ASEC mounts on it.  Since the PMS
    updateExternalMediaStatus doesn't specify the path, we need to make sure
    it's only called for the real ASEC mount.  Otherwise we get into nasty
    race conditions when multiple mounts are coming and going, like during
    UMS transitions, and sdcard-installed apps tend to break.

    Change-Id: I85c6a601e84afd30b44270b0892686c2d864ce8d

commit c8c58f3d14fbb8c77ab1e90541e59fb74bef54cf
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Mar 6 12:34:50 2011 -0800

    MountService: Unmount secondary volumes more carefully

    Use the same message handler for unmounting both the ASEC external-
    storage path and any secondary paths like emmc.  This seems to help with
    additional race conditions encountered on Inc.

    Change-Id: Icca71756fa6721bd85da1f35b8b8c7fc7caa1eb1

commit 47495ab860ed97499e0c4268bf40b1f9c429bf99
Author: atinm <atinm.dev@gmail.com>
Date:   Sun Apr 10 14:50:41 2011 -0400

    Allow multiple shareable SD Cards by using getShareableVolumes()
    to get all the volumes that are shareable and allowing
    sharing/unsharing for all of them rather than just the hardcoded
    getExternalStorage calls.

    Unmount immediately if PM is not updating and not an ASEC
    mount. Change from Josh Stone.
    Change-Id: Iaf1a7a4484deac373e1c1d7bf16d5f22ca49fd64

    Only allow package manager for sdcard (packages aren't on
    external card).

    Change-Id: I0d148ea52dc1285905a9dd061d1ceedcfb761b52

    Take out extra logging.

    Change-Id: I6beb007700ef4be04c3eb273bbf2069c87b30011

Change-Id: Ibc11b9affdf22a438a4d25cf14435fb16b3ad6d6
Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage

The Galaxy S uses the "external SD Card" as the extended storage
and it the notification should be dismissible as it's okay not
to have it.

Additionally, this patch also not hide the USB storage mount dialog
if the removed storage is not the primary storage

Change-Id: I524b294c57ba80f19cf1af808af65ce1308f5a0b
installd: Delete cache properly for devices using datadata partition

The java side already checks /data/data for free space but installd
still checks /data causing it to never reap the cache (because it
thinks that enough free space is available.)

Change-Id: I191f3ceb84df1101ab2918ec0038213d72ec1ce2
stagefright: Fix playback for mkv files with lacing

Most mkv files having 'lacing' in their audio section to save space.
Android did not handle this properly, sending all frames in the block
with the same time code, which causes stuttery playback.

Change-Id: I4dc76e7c2a53126c7fbdd3628fe7d339d2e3364e
framework: Add a version of Environment.getExternalStorageState which accepts a path parameter

Required for improved media scanner on devices with emmc

Change-Id: Id215238f3503221b06459dfa241c2c52ea6a0baa
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Telephony: Add "singlepdp" RIL feature

ICS appears to assume the radio implementation is capable of multiple
simultaneous PDP contexts; maguro, for instance, brings up a second
interface (rmnet1) alongside the primary rmnet0 whenever another APN
is needed.
Other devices (including, from tests, crespo) don't accept this, and
react in unpredictable ways when a SETUP_DATA_CALL request is made before
tearing down any other active context (making it impossible, or at
least hard, to switch APNs).

Since the old setup/deactivateDefaultPDP methods are gone, this patch
adds a back-compatibility "singlepdp" option to the ro.telephony.ril.v3
property, which enforces disabling the default PDP whenever another one
is enabled.

Change-Id: Ib4b030e3f1a32445102ac72aeb68715ef8cebd88
Revert "Don't believe the PV decoder's lies..."

We see corruption in timestamp and hence framedrop
while playing an MPEG4 file. Reverting this commit
fixes the issue.

This reverts commit 977702929b085882aa7a748711cc3280f3195fbe.

Change-Id: Ie7feda68ac203c82f66d7edcd23af14cc9df02e9
libstagefright : Fix to support AVC1 and MSNV file types

-Add Support for AVC1 and MSNV file types in SniffMPEG4
 function
-Function returns true if the header contains one of these
 filetypes

Change-Id: I6d14f4fef0837b2f6d07ffa2f013616ebb76a085
libstagefright : Fix to support mmp4 file type

-Add Support for mmp4 file type in SniffMPEG4 function.
-Function returns true if the header contains one of these
 filetypes.

Change-Id: I3f88b4b34f9c79c7e3172e813751bcf1c18ad58a
CRs-Fixed: 253907
libstagefright: Adding support for k3g1, skm3 and mp41 major brands

This change adds support for ftyp's k3g1, skm3 and mp41 major brands in
the mp4 parser

Change-Id: I816f80ec1ab288df15a41116bb0b2fedd3b2f692
CRs-Fixed: 257978
libstagefright: Add check for zero chunk size.

mp4 file with chunksize of zero causes a infinite recursive call
of parsechunk of the parser resulting in ANR. Added check to handle
this case.

Change-Id: Id522da4c600600628e528a66b2a53468602020ce
Crs-Fixed:254974
Fixed issue with MPEG4 with 0 audio channels.

Removed check that numChannels != 0 in MPEG4Extractor.
The problem was that numChannels==0 valid, and implies that
the number of channels should come from the audio object
embedded in the MPEG4.

Change-Id: Ibe1b8f1d81ea661932ff1a1c02ed5b992068c15d
CRs-Fixed: 249523
libstagefright: Check for H.264 profile when using sw decoder.

- Adds a check for the video profile when configuring the H.264
software decoder. Returns error unsupported if the profile
is not supported by the decoder.

Conflicts:

	media/libstagefright/OMXCodec.cpp

Change-Id: I38ad7db7bd7c623b26b75e4cf97db196b5bafe25
Revert "libstagefright: Check for H.264 profile when using sw decoder."

This reverts commit f76cf567b3b4c046805463c4e02cb04b4f04d7e6.