fb: handle for our navigation bar recentspreload in the button

Recents screen is since some time wonky. With new hardwarekey rebinding
it showed now only more how wonky it is due that home button does not
cancel the preload always to keep the hwkey button logic alive.
As well a problem is that if you bind recents to whatever other navbar
button the preload takes no effect at all (is only binded from google to
the recent tagged view)

Whatever to solve this let the buttons itself decide dependend on the
action if a preload or cancelpreload is needed an peform the action.

This solves all the weird recent screen behaviours and we will need it for
the new recents screen which is in development as well

It looks a bit weird to aquire the statusbar service here for this but in the
button itself there are not much other alternatives. In theory we could set listeners
like google but instead to all buttons and fetch the action from there to decide but
this gives a problem to get if it was a longpress recents or a normal press recents.

So this way seems to be ok.

Change-Id: I9b3b08356f72840399eaabd0be8b0c3fdf09a4bd

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
fb: handle globalmenu in SlimActions not over Powerbutton anymore

We used till now a hacky workaround to show up the Power menu which worked
but is indeed not the best way. Last tweek on it broke 3rd party root application
which use similar hackish workaround.

Whatever make global menu over wm service available and call it from
SlimActions directly. This respects of course the usual security checks
if the device is provisioned etc

PS
- derp
PS
- puh I just should go sleeping :(

Change-Id: Ia12ce467cee0d60741079b3fa2c78449d707a09f

Conflicts:
	core/java/android/view/IWindowManager.aidl
	core/java/android/view/WindowManagerPolicy.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/wm/WindowManagerService.java
	tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java
Appears black screen fix for a while

This issue is side-effect of added google patch on KK MR1.

Fix a couple of issues with mOpeningApps.
https://android.googlesource.com/platform/frameworks/base/+/a8ee262c04749db4f32f73d2b9e7f58989c4638b%5E%21/#F0

[Reproduce path]
Settings -> Location -> Location OFF -> Location ON -> "Location consent Dialog" Popup-> "Agree btn" press
-> Black screen appears for a while

Change-Id: I14efdce87e8d78d38f9aae48568f69937e4fe1fa
fb: unbreak recents animations on thumbnail click or dismiss recents screen

We load now correctly the recents screen and preload the first task on press
down off any key to get always recents without issues up. We cancel only
if any other key was pressed. I discovered during I am working on new recents
that this solves all issues but has one downside that if he user dismiss he recents
screen or click on one of the thumbnails to bring the choosen app to forground
that of course the last thumbnail is not cleared. Due that the entry animation
and some other things depent on what is currently preloaded we need to cancel
first task to have always in all cases the right animation.

Fix it with just calling cancelPreloadingFirstTask() if the user either
clicked on one of the thumbnails or dismissed the recents screen.

PS
- do the same when all thubmnails are swiped away
PS
- derp

Change-Id: I786c05d929f6a02b6d4928fc4a96aeb9a8e2d03e
framework/base: Add EdgeGesture service.

Based on code of PieService.

PS
- add more sensitive steps

default: 5, minimum: 1, maximum: 10
PS
- fix mask derp
PS
- cleanup
- reduce left and right trigger to from 80% to 70%
  till new size flage for the service are ready

Change-Id: I053737e36340a5ec6814b21eb87575f9689c7e88

Conflicts:
	core/java/android/service/gesture/EdgeGestureManager.java
Frameworks: SlimPie (1/2)

Well first I want to thanks again for the ideas Jens Doll, Kyrylo Mikos and PA gave us
on 4.3 allready to make our own SlimPie possible. We used partly code from them and added
and changed it in our Slim way to have it for us most usefull.

Well as known SlimPie advantage to other PIEs is that it can bind on every button
press and longpress action like the user want. All SloppyActions are available for
every button (so all possible shortcuts we have + apps etc). Of course as well
available are custom icon images or system icons. Other unique thing of SlimPie
is that 2 rows are available. First row user can setup up to 5 buttons. On the second
row up to 7 Buttons.
Of course the user can setup the style to their like and still theme engine related
things are respected.
Pie is activated present on non expanded Desktop as well

For 4.4 we reworked a lot of the frameworks base code mainly. Changes compared to 4.3

- We use now a edge detection service (thanks a ton to Jens and Kyrylo). We tweaked it only
  very minor due that it works allready out of the box. Two reasons why we want to use it.

  1. We do not have detection overlays on the borders anymore. Means the user is not disturbed
     by it and we do not need to add workarounds like we did before to avoid accidental swipe ups
     (eg old IME reduce triggers). As well it is not needed anymore that the user can setup
     thikness etc. The default values are allready quiet good. If a device has detection problems
     the dm can adjust them via overlay. As said main main main advantage  that no dead zones are present
     anymore.

  2. we will use this service for other upcomming features as well (eg new Recents)

- Centralized and adapted the code to 4.4 and some changes we did in our central classes
- reduced observer to an absolutly minimum. If PIE is disabled it does not observe any value
- A lot small fixes and tweaks
- Change default colors to KK style
- If navbar is present the navbar gets animated with the background to give a full screen overlay
  feeling to the user. Especially now with kk transparency way better.
- Full keyguard support
- complete reworked edge disable detection
- and a lot more

PS:
- add and fix the callbacks
PS:
- cleanup
- multiuser support
- reworked complete observer and attach detach handling
PS:
- fix some detection corner cases
PS
- fix derp
PS
- for pie add higher default sensivity. As well give an option
  to overlay it in device tree to set it even higher.
PS
- refresh settings if user changed
- small cleanup
PS
- fix another derp :(
PS
- add disable activation edges logic

  if navbar or statusbar is present (either visible or as swipe in expanded the bottom and top are disabled)
  is notification drawer is down top left right is enabled
  if one of the different navbar modes or the navbar in the current view has 0 height this edge is enabled
  if navbar is off navbar edge is enabled
PS
- our service is always present
- cleanup commandque as well aosp and our code
- some minor tweaks
PS
- animate navigationbar on non expanded to overlay the background on pie over the complete screen
PS
- add recents preloader logic
PS
- space out a bit the clock
PS
- change default colors
PS
- use our color classes and fix it that they can handle our new logic
PS
- cleanup
PS
- fix second layer disable
PS
- reflect new sensitivy steps in edge service patchset
  (1 minimum, 10 maxium)....pie default to 8 high sensitivy
  if someone need mor increase it
- in general made it per default a bit more sensitiv
- fix bug with trds switch on reconstruing statusbar to
  restore last correct state
- cleanup the inline comments
PS
- minor tweaks
PS
- fix reported wrong icon sizing of some apps which do not follow
aosp default sizes
PS
- fix race conditions on init
PS
- attach basestatusbar directly to PieController and pass to PieView to simplify
  recents loading
- cleaned up some method and var definitions
PS
- remove obsolete null check

Change-Id: I3b28b8155a668f2c9b32aac4cd294b79ac3f3eb9

Conflicts:
	core/java/android/provider/Settings.java
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	core/java/com/android/internal/statusbar/IStatusBarService.aidl
	core/java/com/android/internal/util/slim/ButtonsHelper.java
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/config.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/res/values/sloppy_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieItem.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieSliceContainer.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieView.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/PieController.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/StatusBarManagerService.java