Squashed commit of installd changes

commit 28d7796cef6dfb1c892b736fc89c5bd9d919ff29
Author: rpcraig <rpcraig@tycho.ncsc.mil>
Date:   Wed Nov 28 09:23:18 2012 -0500

    Proper security labeling of multi-user data directories.

    This patch covers 2 cases. When an app is installed
    and the resulting data directory is created for all
    existing users. And when a new user is created and
    all existing app data directories are created for
    the new user.

    Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>

    Change-Id: I01f2a9084dfe7886087b1497070b0d7f2ad8478e

    Conflicts:
        cmds/installd/commands.c
        services/java/com/android/server/pm/Installer.java
        services/java/com/android/server/pm/PackageManagerService.java
        services/java/com/android/server/pm/Settings.java

commit 91dfb0045a0026b185fa66c5c95289335bd2d543
Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date:   Sun Dec 25 17:37:53 2011 +0700

    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: I736af6ff7ea0c8ae07900168f6b8ac2f7a4dbe0b

commit 777c17568851e1dc8b02213b2a77a3d7b456fc7d
Author: ctso <ctsoyars@gmail.com>
Date:   Thu Jun 24 02:03:47 2010 +0000

    DexOpt anything on /system in /cache/dalvik-cache

    Change-Id: Id41d37047f2fcb90d513ac091dfcb85492473689

    Allow property to disable dexopt on /cache

    Change-Id: Ic74707c4bead387bbf82e4c6d5037efc2d2ebeaf

Change-Id: Ic74707c4bead387bbf82e4c6d5037efc2d2ebeaf
make TARGET_QCOM_DISPLAY_VARIANT more parametric

Change-Id: I36bba3ba96e174b443d800fd79957a1f428899df
Reset the FrameNumber for dropped frame in async mode

In Async, reset the framenumber of frames dropped by the BufferQueue.
This allows the client to dequeue and use this frame before the other
queued frames which may be with the MDP.

CRs-fixed: 448606

Change-Id: Icaabf77b55a7275dc98ba1fdfba89508feb92145
Check fence is not NULL before dereferencing it

If the fence obtained in dequeueBuffer is NULL, don't dereference it.
This will avoid a crash in surfaceflinger.

CRs-fixed: 516300
Change-Id: I3054dc37087103f3addae7884bb03460484a1eec
Surface: Initialize variable and add a defensive check.

Initialize buf variable and make sure to check for return
value of dequeueBuffer() before sending to the client.

Change-Id: I0569f2d45825fab0e5d0f38fc91a07990f57c7ab