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

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

Change-Id: I053737e36340a5ec6814b21eb87575f9689c7e88
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

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/ButtonsConstants.java
	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
	services/java/com/android/server/StatusBarManagerService.java

Change-Id: I3b28b8155a668f2c9b32aac4cd294b79ac3f3eb9
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>
Fix the issue that the top of fullscreen dialog is clipped away

The visibility of status bar comes from the top fullscreen window,
not from the focused window.
That has to be taken into account during the calculation of the
decor rect. You can use mTopIsFullscreen for this purpose.

Change-Id: I6159eb2ee389885cf5ab507157f9451841364d2f
Fixed cancel() not working correctly

The method handleMessage(Message msg) from mHandler variable was
not checking if the timer was cancelled, so
sendMessageDelayed(obtainMessage(MSG), delay) was keeping the
timer alive. The patch simply adds a boolean and checks if the
CountDownTimer was cancelled before calling
sendMessageDelayed(obtainMessage(MSG), delay)

bug: https://code.google.com/p/android/issues/detail?id=58668

Change-Id: Ic6bbb9d33a3616f8503db222513cc14ad2270cb8
Signed-off-by: jl1990 <jlcarrasco1990@gmail.com>
Only send storage intents after boot complete

It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
Remove unused field from AssetManager.

This field was introduced in commit 4bdd33b81a17 but wasn't
used there (or since).

Change-Id: I0615e98b8990d42da6b85f8094ab19eb0465fd9e
Telephony: Modify code to check that PUK code length is always 8.

As per 3GPP TS 31.101 Release 11 section 9.6, the number of digits
for UNBLOCK PIN (PUK) is always 8.

Change-Id: I4ea69fd8e2e8e96330d10a67b2d1f5a1859c1016
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
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
GpsLocationProvider: look for config file in /etc/gps.<ro.hardware.gps>.conf

The property ro.hardware.gps can be specifid to allow a single system
image to work with differrent GPS chips.  The HAL layer will use it to load
/system/lib/hw/gps.<ro.hardware.gps>.so.  Add support to GpsLocationProvider
to use the same property to find /etc/gps.<ro.hardware.gps>.conf, falling
back to /etc/gps.conf if the property is not set or the file is not present.

Change-Id: Ib285c4d28b0d0be5e038a1e61822edd8bc6d97d9
server: Handle broadcast intent and receiver

Ensure the receivers of broadcast intent is not launched before boot
completion by adding an intent flag, since connectivity events can
happen before boot has completed.

Change-Id: Id6fc9e34c89d947d768def38e5c5bb0df54a3a7b
Release wakelocks acquired by SyncManager

Release the wakelocks internally acquired by SyncManager to improve
power performance.

Change-Id: I6d9663292cb4471d92ed9132beb7ed1ba2e8128f
CRs-Fixed: 585825
Frameworks: Imagehelper...do a nicer resize with better quality

Change-Id: I209afc73ef6a69c919c0d504d34de72525bc5b0d
Merge "Frameworks: Imagehelper...do a nicer resize with better quality" into kk
Merge remote-tracking branch 'upstream/kk' into kk