A metric-butt-ton of cherries from AOSP's Gerrit.

Squashed commit of the following:

commit 71337dfc4431c60d3bbf2082806311854ff51f77
Author: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
Date:   Fri Oct 26 13:20:55 2012 +0200

    Change the watchdog monitor to avoid false positives

    The critical section in the run's method might lead to
    a race condition overwriting the mCompleted flag.
    Generating a false positive detection.

    Change-Id: I4460cbcca83199f9c81b4bcd6bfa04cec39271e1
    Author: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
    Signed-off-by: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 63690

commit a7d9958cd4678ad77c8eb6c2ec85d9396c15a8e6
Author: Fabien DUVOUX <fabien.duvoux@gmail.com>
Date:   Mon Dec 24 11:44:52 2012 +0100

    Check ProcessesReady before broadcast

    Most of the time testIsSystemReady is used to know if we are allowed to broadcast intents.
    But in broadcast intent method we check mProcessesReady flag (not mSystemReady).
    If we broadcast after systemReady flag but before ProcessesReady flag, system will crash

    Adding condition to check if system & processes are ready fix that race condition

    Change-Id: I17e42bff957164b139f85ee92ace1c5867e7265a
    Signed-off-by: Fabien DUVOUX <fabien.duvoux@gmail.com>

commit 642964c764720ea447e10aea644051f529dbfd0a
Author: Yijun Zhu <yijunx.zhu@intel.com>
Date:   Wed Sep 5 17:38:28 2012 -0400

    [Browser]UI control button first flash chaotically at wrong place when playing http live clip

    Rotating the device orientaion when playing a video in fullscreen mode,
    the controller bar flash chaotically at wrong place for a second,
    and then back to right place, Now add  a interface to hide it,
    since ensure it will get repositioned and reshow at a later time.

    Change-Id: Iea98399b43daae51d2eeb18835782e10c045549a
    Author: Yijun Zhu <yijunx.zhu@intel.com>
    Signed-off-by: Yijun Zhu <yijunx.zhu@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 38905

commit 70a6b6b042ef37715b355066a27ad9a46cfd3c4c
Author: Jian Li <jian.d.li@intel.com>
Date:   Fri Jul 20 10:34:07 2012 +0800

    OrientationListener: add SENSOR_DELAY_NOPOLL

    Add a new delay (SENSOR_DELAY_NOPOLL) to SensorManager. It is dedicated
    to WindowOrientationListener to avoid polling accelerometer sensor to
    save CPU power.

    Change-Id: I0f117f1078b2b91a54ab59fc95e059f57d005a56
    Author: Jian Li <jian.d.li@intel.com>
    Signed-off-by: Jian Li <jian.d.li@intel.com>
    Signed-off-by: Wang Zhifeng <zhifeng.wang@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 21534

commit d730b34f772d8e6566255f1d2d8b57a863ea1048
Author: Dmitry Shkurko <Dmitry.V.Shkurko@intel.com>
Date:   Mon Aug 13 19:19:36 2012 +0700

    Avoid C++0x feature

    All other sources from frameworks/base do not require C++0x support.

    Change-Id: Ib82dabd296b954bbed0657946a41053f151a6179
    Author: Dmitry Shkurko <Dmitry.V.Shkurko@intel.com>
    Signed-off-by: Dmitry Shkurko <Dmitry.V.Shkurko@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 51499

commit e02af26876657886fbba260fa4e4e9ce4b63e9e6
Author: zobject <zbjection@gmail.com>
Date:   Fri Dec 14 21:11:08 2012 +0900

    Fix NullpointException problem in onMenuItemSelected

    If both title and condensed title is null,
    item.getTitleCondensed() could be return null value
    in onMenuItemSelected. therefore need to check
    whether retun value is null or not.

    Change-Id: Ib08f52b949a794aa7bd6cc25414041e820f62969

commit 2dde5056c438bb6d305cb4eb744280ef6a0c1407
Author: Bing Deng <bingx.deng@intel.com>
Date:   Thu Nov 29 14:14:47 2012 +0800

    Catch the NameNotFoundException and return to avoid null pointer when updating package in AMS.

    Change-Id: I26cf200cc84639e1261085b6905a567320cbb0a9
    Author: Bing Deng <bingx.deng@intel.com>
    Signed-off-by: Bing Deng <bingx.deng@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 63612

commit bef007439b143fa5667c56b9e87bc2685bfeb9c2
Author: Pavan Kumar S <pavan.kumar.s@intel.com>
Date:   Fri Aug 3 12:03:01 2012 +0530

    [BatteryStatsImpl] Avoid memory corruption due to Parcel Recycling

    While processing batterystatsfile, in present code there is a race where a parcel
    might be recycled while it is being written to disk in another thread.

    The write process is done in 2 steps:
    - write into a Parcel (memory block)
    - then write this Parcel to disk using Journaled API.
    The Journaled API ensures robustness against file-system issues due to power cut.
    The writing is done in batch using a thread running commitPendingDataToDisk().
    This function writes the parcel to disk but this parcel is a global variable
    initialized by writeLocked(). If the writing takes too long time and two write
    threads are launched, the parcel is freed by the second writeLocked() call;
    which could cause the memory corruption.

    Hence, change global Parcel variable by a Parcel parameter to commitPendingDataToDisk()
    and only this function will be allowed to recycle the parcel.

    Change-Id: Ie86ee0a66434b7107264c79f68411196c7505a34
    Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
    Author: Pavan Kumar S <pavan.kumar.s@intel.com>
    Signed-off-by: Shuo Gao <shuo.gao@intel.com>
    Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
    Signed-off-by: Jack Ren <jack.ren@intel.com>
    Author-tracking-BZ: 47466 19426

Change-Id: Ia189b1de29b2fbd49eaf84e21aaed2054daa50a1

Conflicts:
	services/java/com/android/server/Watchdog.java