recycle TypedArray calls in F_B

PS2: plus a few other minor fixups to typedarray handling
PS3: add a few more recycling calls and remove unnecessary try/finally from keybuttonview
PS4: remove all unused typedarray imports

-Vanir \m/

Change-Id: I004ce627a861a2c5e262709cb1110f5aea536719
Signed-off-by: scott <scott@ubuntu.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
Scroll: modified velocitytracker

Velocitytracker and overscroll are called on every touch event to
calculate if there is a scrolling/fling. Move this and the recycling
to static voids so they are pre-optimized at compile time rather than
after evoking the method call during runtime (JIT) to increase responsiveness.

-Vanir

Change-Id: Ic7351da58f29281ca2b6a788386b95b68b552390
Avoid IndexOutOfBounds Exception in ActivityManagerService

1. finishActivityLocked() doesn't give guaranty to remove only
   one ActivityRecord from the history stack.
2. Unfortunaly if our topRunningActivity is top of the stack,
   then there is potential IndexOutOfBounds Exception in
   ActivityManagerService.
To avoid it, we can just traverse to the top of the history stack.

Change-Id: Idf06356e643789ccfd493d7097278cea44bdf395
Don't ANR when no windows are touchable.

If the user touches a portion of the screen in which all of the windows
have FLAG_NOT_TOUCHABLE set, handle this as a failed event injection,
so that it doesn't result in ANR.

Change-Id: I6437e3dd1641005b8ac80f6cf7d20b14b97fcc7b
Make ActivityManagerService.systemReady thread safe

During boot of the framework, two threads execute code in
ActivityManagerService and ActivityStack, respectively. At one point
in time, the latter thread checks the internal state of the first
thread, but if for some reason that thread has stalled for an
unexpected amount of time, the state has not been updated (yet).

An example of the above is when one of the services started from
SystemServer (eg AppWidgetService) takes unexpectedly long to start.
This causes the framework to boot without broadcasting
BOOT_COMPLETED, which in turn has ramifications for the entire
system.

Change-Id: I14b5f6fcb320be01596a2e04db3f724a43f4fbe1
SystemUI: Ignore lint check ProtectedPermissions

Change-Id: Idf8ccd37cfb02e6da136187eb872e97e22b158e6
Add Motorola EMU audio dock jack sensing support

Don't route to dock output just because the device is docked.
Let the actual jack presence to control it.

Change-Id: I4066d08b1aa58ead39aad9410b9dd71624776187
FW: Halo: Remove expanded desktop dependency to longpress action

* Always on is much better!

depends on: http://review.pac-rom.com/#/c/2456/

Signed-off-by: iGio90 <giovanni.rocca.90@gmail.com>
Change-Id: I777d65cc38b3d84212f04ce6405ceb5de8384903
Reduce EntropyMixer seed size from 4096 to 512 bytes.

The suggested seed size from Linux drivers/char/random.c is 512 bytes
rather than the 4096 bytes currently used.

Change-Id: I3dd55105f0a95ce9cda34b4cf08987b8a28c4ac9