Fix the screen-off animation ignoring value set in ro.sf.hwrotation

Before: http://www.youtube.com/watch?v=lGzz5agWvro&feature=youtu.be
After: http://www.youtube.com/watch?v=NSq0uWqlAjM&feature=youtu.be

PS2: Rebased
PS3: This doesn't need to depend on unrelated commits.

Change-Id: Ib0729440cc76a604ff400cb9c4e8da3350b7d214
Battery saver mode: Revamp !

credits to Yanuar Harry
<ai.the.smarties.physics@gmail.com>

Change-Id: I22e45d652a1823698927d72f88daa9ad8bf55737
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Signed-off-by: hany <hany.alsamman@gmail.com>
[Navigation bar] Allow "right to left" gesture to launch search panel

Symptom: "Bottom to up" gesture can launch search panel in portrait, but "right to left" gesture CANNOT in landscape.
Root Cause: Not handled.
Solution: Set swapXY to handle this in landscape case.

Change-Id: I1793280b3656af6912e6b4583b08e80a0a38e44a
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>
Marquee text RTL improvements

Changed marquee text to scroll according to
the reading direction. Arabic text will
show the right edge and scroll towards
the left edge and vice versa for Latin.

Corrected marquee flicker when scroll animation
finished. The ghost scroll's x position was cast
to int and it made the text flicker when
marquee stops.

Ghost part didn't display for RTL languages.
Added multiplication with
getParagraphDirection to negate the ghost
offset.

Change-Id: I689039118df01a62f73ef0079c857fea1bfcc5a0
Fragment animations are not being saved across configuration changes

As per comment #5 in issue #25994:

The problem here is not that the state isn't saved and restored, the problem is how the BackStackRecord is rebuilt.  The ops themselves do save and restore the state, the problem is in BackStackRecord#addOp.

    void addOp(Op op) {
        if (mHead == null) {
            mHead = mTail = op;
        } else {
            op.prev = mTail;
            mTail.next = op;
            mTail = op;
        }
        op.enterAnim = mEnterAnim;
        op.exitAnim = mExitAnim;
        op.popEnterAnim = mPopEnterAnim;
        op.popExitAnim = mPopExitAnim;
        mNumOp++;
    }

The enter, exit, popEnter and popExit animations are overwritten with whatever is currently in the record, which during the restoration process these are 0 so the values which were saved in the ops is lost.

Change-Id: I095cc7ff4ae65581d728f34217fb873ad2f0c574
Session: Add a shortcut in detecting if a window that contains the wallpaper is null or not

originally, a null window would be detected in WindowManagerService, an exception would be thrown, and then that would be caught in Session

Change-Id: Ib937d029bb7a27dac15ff38ecf3b4fbb51bc417c
NotificationManagerService: notifications with icon==0 are FINE WITH US

This warning reminds me of that saying about squeaky wheels... "the squeaky wheel gets PUNCHED IN THE HEAD"

Change-Id: I3e1a1e55ce3ce1f70c7b187a237625257bdbd591
Signed-off-by: pcarenza <pcarenza@gmail.com>