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:

	Android.mk
	core/res/res/values/dimens.xml
	core/res/res/values/slim_symbols.xml
	services/java/com/android/server/SystemServer.java
	services/java/com/android/server/input/InputManagerService.java

(cherry picked from commit 5d67d513221960cf924e242c44097ad77369764d)
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 SlimActions 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/com/android/internal/statusbar/IStatusBar.aidl
	core/java/com/android/internal/statusbar/IStatusBarService.aidl
	packages/SystemUI/res/values/cr_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/PhoneStatusBar.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

(cherry picked from commit 889372f2d33f940e5b5f7384e8a91fbc6fe610ca)

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Frameworks: fix qs and notification shade toggle on expanded desktop

If expanded desktop is enabled and statusbar hidden the toggle does not force
the statusbar to show before it pulls down the shade

fix it with just requesting the the statusbar to show up before we actually
peform the action

Change-Id: I15805a57485220f083a3439617cceef8bd5c04cd
(cherry picked from commit 3049f09bb11864086dd396dd2d92ca41fd33e73c)
Frameworks: Add user protection and pie/navbar toggle to SlimActions

Add drawables for it and enable it for navbar, pie, hwkeys
and GlobalMenu and whatever other shorcutfeature want to have it

Keep the user save and do not allow to disable all navigations to keep
the device usable. User will be notified

In Settings user get the choice to enable the other navigation method. Of course
only on navbar devices due that hw key devices always have a working navigation

PS
- extend it and make the actions on global menu as toggle action
  to show on/off and reflect it on the icon as well

Change-Id: I69227e6653f4fe780aa41a91e3d4896d9ccc0f0a

Conflicts:

	core/res/res/values/slim_strings.xml
	core/res/res/values/slim_symbols.xml
	policy/src/com/android/internal/policy/impl/GlobalActions.java

(cherry picked from commit ca2e97b95e77c83ae80d9b7e7694fb6b68d754ea)
Frameworks: Imagehelper...do a nicer resize with better quality

Change-Id: I209afc73ef6a69c919c0d504d34de72525bc5b0d
(cherry picked from commit 7621976ba60286a0cb04720e642b425bd02bb9a5)
BroadcastQueue: fix class typo of next receiver

nextReceiver should be cast to ResolveInfo
instead of ActivityInfo since it's ResolveInfo
that is pushed into List r.receivers.
Otherwise nextReceiver will always be null
as there is no ActivityInfo in r.receivers.

Change-Id: Iea3a720e6d7296fedff318643a1b4f5b9fce900c
Signed-off-by: Leavitt Zhang <leavittz@nvidia.com>
(cherry picked from commit 6f168b7f9704107399973dcc3b55b38a591bd4f9)
Make sure to turn off led after pulse()

setLightLocked() will update mColor. This will cause the led to not be
turned off after the pulse.
When notificationManager starts a attention pulse the led will be kept
on. Since attention is of highest prio nothing can turn it off.
This is fixed by resetting mColor back to 0 after the call.

Change-Id: Id60ef96e5c21b47c23002f0bcf2fae7fb3f2ca10
(cherry picked from commit 8aec0843ac3ed3a8f3f5a04bc97e858c025dd553)
SystemUI: Slim Actions to Shortcuts (1/2)

Change-Id: Ic7cc70b5a55e98b1fd6784380049f54d0bd3f4d2
(cherry picked from commit bdf7063f1316b27033a017d2e212fd565ae91c90)

Conflicts:
	packages/SystemUI/res/values/cr_strings.xml
	packages/SystemUI/src/com/android/systemui/CreateShortcut.java
	packages/SystemUI/src/com/android/systemui/shortcuts/SleepScreen.java
Remove duplicates

(cherry picked from commit a929d73451b60db4e78f5699fb6da02c04a5ed78)
Frameworks: fix navbar and pie icons for tablets and RTL

well due that we use a completly other attempt then googles navbar we do not
need to rely on different sized icons for portrait and landscape. So just a square
icon fits our needs perfect (which is so or so everwhere in AOSP default to use square ones).

Whatever recents pie feature showed us that we still forgot to size the pictures for our tablets
and as well for RTL user.

So let us do it now to fix any resizing issues on navbar and or SlimPie

Change-Id: I5257b789a5450754a296141b0af63d2eacaa87c9
(cherry picked from commit 1d0baed23064f3192f231ffb916a40de4b6facdd)
Framworks: clean up the AOSP tablet icon mess

well.....on grouper the overlay size for the navbar is/was 56dp...so
google added bigger icons then the usual ones into the sw600dp folders.
Well newer tablets have 48dp as default like the phones so the slightly bigger
icons do not fit 100% correct. It is not much but it is noticable.

So all devices have same navbar default height...so all icons should have same size
as well. Just remove the overlay icons so that the system automatically chooses the right
one from the default screen qualifier.

Change-Id: I4e4d87d70996ed1def359149cea829b5794f2448
(cherry picked from commit 02d493bef3f22acd8f04dbab5aba50d987a346d3)
Remove duplicates

(cherry picked from commit 0d845fb259a85c613038a20213669820ef0c00c5)
[1/2] Base: ActiveDisplay (rework interface)

really fix AD buggy stuff
tested with Music play
tested with No lockscreen
tested with faster screen turn off
check all sensor going off if AD not Showing or Disabled
fix notification posted/removed
make AD using System Window so it will covered all screen
fix Navbar translucent if Lockscreen Blur merged :P
now using Rounded Image
also introduce new RoundedImageView widget
 courtesy of @vinc3m1 (thanks)
fix build

Change-Id: I1fc3047496cce71cefc1718b8ef3f4c4fc1605eb

Patchset: 12
https://gerrit.omnirom.org/#/c/5132/
(cherry picked from commit 2b9f54c10f14389842401ba659d50dd5e8878210)