Fix Watchdog HeartbeatHandler to run on correct thread

The HeartbeatHandler for the System Server Watchdog has been running
on the wrong thread due to a race condition in initialization.  It's
designed to run on ServerThread, so that it can catch lockups in the
main looper of the System Server.  It has been running on
ActivityManagerThread instead, so it does not detect lockups on the
ServerThread as it should.

ActivityManagerService is calling Watchdog.getInstance() before
ServerThread calls Watchdog.getInstance().init(), so the handler is
being bound to the ActivityManagerThread instead of the ServerThread.

Explicitly bind HeartbeatHandler to ServerThread, so that the Watchdog
catches lockups on this critical thread.

Change-Id: Iccb184ac3adb817feb86ed4ee0e50e443bf74636
SystemUI: StayAwake Toggle

Instead of overcomplicating toggle, onLongClick simply takes the user to
Settings$DisplaySettingsActivity instead. onClick (on) sets screen timeout to
int MAX_VALUE(approx 24 days), and restores user value onClick (off).

** Icon Credit to Nitroz(Thanks a ton!)

Change-Id: Ifd2051b2a6e8235160713cad3b4385dbb6d66b8f
Signed-off-by: bmc08gt <bmc08gt.teamb00sted@gmail.com>
FX: NavRing fix longpress derp.

Change-Id: Icebb34612b65ff30e427f237780b366f94a9b24e
Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>
Frameworks: Add Permissions Management to AOKP [3/4]

Allows the user to revoke individual permissions on a per app basis.  Adapted from
CM7 commits 949eb057d81da7cd0a79fc1fe9cc9c4d989d1c27 and 4a0a352b36b21d0d22713c232baccca84ce13a2d
to work with 4.2.2

Change-Id: Ibc7be45b88838a2fffaff80514e77702d330de0f
Signed-off-by: Rohan Mathur <rohanmathur34@gmail.com>
FW: Ribbons Padding, Click options, autohide updates 1/2

Adjustable padding
vibrate on click optional
if no short action set use long action icon and
  dont set short click listener - long press only mode...
Autohide flakiness fixed
Don't unlock on torch

Change-Id: I45c9f29453220e80249300b66bb61d5a7afc784f
Replace statusbar drawables

Since we will be using Per-App colors from now on, these drawables will be optimized
for this feature.

Credits to ParanoidAndroid for the icons.
Fix FC when PAC is disabled
xFW: Ribbons Colorize action icons, unlockmethod

Unlock method for if action should be unlock or not.

now torch, notification, and power shouldnt unlock.

Change-Id: Ic0978f145c8ad4f6f944cd603bfe744415d44561
Revert "Policy: Lockscreen Targets Unlock speed update"

This reverts commit 3b2572c2bb0c55b8f41fa9466b2a5da0abc83c05.
Policy: Lockscreen Targets Unlock speed update

Fixes lag on the classic lockscreen targets and sets up a broadcast
receiver to use those methods from outside of policy like navring
example this commit and the future AOKP Ribbon.

Change-Id: Ia0735aa26a4cd1a2c95d0860992837daf5cacf6d

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java
Can not mark the same content of browser page after copy

Marking a text on the web page and then press copy works,
but trying to mark the same text again does not work.
The reason for this is that the selection never gets
cleared in webkit.
The fix, calling cleaSelection in the onDestroyActionMode.
Also added clearSelection when getting an
onConfigurationChange.

Change-Id: I59b384cb5441b6a3a05007ea7e77f9699889a87c
aapt: localizations: be more aggressive

* errors instead of warnings for:
  * A localized string for which no default-locale version exist.
  * A localized translation of an translateable="false" string.

Change-Id: Ib700fe323019f285f5a1931fe96500b2de03106b
Profile Toggle: Don't use intent
FW Ribbons Swipe ribbons seperated && logic adjust for navbar

If you have an enabled navbar weither by default or user seleted
the bottom ribbon has not been available. If the user manually
hides the navbar I will allwo them to use the bottom ribbon.
They can also long press the hidden navbar handle to get the
bottom ribbon.

This also makes the left right and bottom their own ribbons.

Change-Id: Icba9c4ec510149bef74382a3bf59fd79b3ef87c4
Dynamic glowScale adjustment and spacing of NavBar.

This adjust the Glowscale for the NavBar buttons based on
the number of buttons on the bar.  I also added spacer
views to the outer edges of the NavBar.  This helps alleviate
conditions where the glow was cut off on outer buttons (especially
in tablet UI).  It also makes the Glow more appropriately sized
as the number of buttons increase.

There are still some cases where an excess number of buttons,
and a small navbar percentage (TabUI) is going to create some
glow cut-off conditions.  That's just going to be unavoidable when
the user tries to squeeze it down that small.

ps 2: Adding the spacers now only occurs on TabUI.  This prevents
    major changes to the look/layout of buttons on Phone/Phablet,
    but still provides glow cutoff release for tablets, as they
    were the worst effected.
ps3 : adjust the size of the separators to not squeeze navbar too much

PS4 : whitespaces

Change-Id: Ic6d9deb4ae49c87251b8b258ff0f42da46910986
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
FW - Restore Padding in NavBar Buttons.

In a prior patch to adjust NavBar glow I removed extra padding
that was inserted when there was only 3 buttons.  This caused
the NavBar to tighten up a bit on this case.  This restores
the previous condition of adding a little extra space when
only 3 buttons involved.

Change-Id: I9177cd7eaa795c3705f4e83362648aca992d2fe3
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
Navbar: Bring inline with AOKP frameworks
navbar/navrings: new layouts for nav rings
fixes issues with nav rings in landscape.
We do not use mCurrentUIMode from aokp
we will use mSystemUiLayout like we used before for other fixes,
this commit also seems to fix the recents lag.

Conflicts:
	packages/SystemUI/src/com/android/systemui/SearchPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Some code changes?

Since we dont use mCurentUIMode from AOKP anymore, change to mSystemUiLayout?
Fix HTC headset handling.

HTC's headset driver adds additional bits to the switch state, which
we're unable to deal with. Fix that by masking out those bits and
keeping only the valid ones.

Change-Id: I29f0de9520ebb56d61acbc9a6dfcfc73e1f297d8
Fix build