Option to use volume keys to control media volume anytime (2/2)

See Settings part for description
added contact lockscreen icon

Change-Id: I204e3a43d3e2beed391e605f3d3add55b24bb4b7
Send out a configuration change when screen size changes due to expanded
desktop.

This kills the status/nav bar hide/show animation, but it's required by
some apps to recalculate their content correctly.

Change-Id: I3f4844815005acab111853fa707cd461f83e2efe
Frameworks: take  mPieScale into account to calculate estimated PIE width

if scaled size of the PIE is over or under the default size
the pie was either no using the whole screen space or
it was cutted off. To solve this take scale value
into account when calculating estimated width

greetings SlimRoms

Change-Id: Iccfc8362c0019e3b6ff4bd8066c313c67116c014
Framworks: disable observer and receiver if PIE is disabled

on high end devices that is maybe not needed. But there
is in general no need to enable the obeserver/receiver
when PIE is disabled (or expanded mode is off)
This change destroy and disables the PIE in most parts
when it is disabled. + a small doubel register
correction

greetings SlimRoms

PatchSet 2:
- remove PieLayout observer completly - thanks Jens

PatchSet 3:
- remove unnecessary call to setupSnapPoints()
- reuse already created snap points

PatchSet 4:
- small corrections on setupSnapPoints() and call
- remove not needed second call of PieController attachTo()
- disable TelephonyManager listener

PatchSet 5:
- fix up detach logic

PatchSet 7:
- cleanup

PatchSet 8:
- Effective Java rule #41
- fixed some pie controller leak

Change-Id: I8ef8797e7d4f8ee73d31a8296f5747415567bbda
Add a option to hide power off option for power menu on lock screen (1/2):

Some security apps require the device to be turned on to allow the
owner to have full remote control over the device in the event that
the device is stolen.  Having the power off option on lockscreen
can allow anyone to power off the device even when a lockscreen pin,
password or facelock is being used.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Don't show reboot menu on keyguard, this can be a security risk
Signed-off-by: Paul Beeler <sparksco@gmail.com>
Frameworks: Fix do not show snappoints if triggermask disables edge

as the title says do not show on lockscreen or notification
drawer the snappoints on the disabled edges. Pass
trigger slots and mask trough and take into account

PatchSet 2:
- some refactoring

Change-Id: I0413ffe86169c5d1cb906598d6006bbf1463770b
Don't include flags in configuration change if their value hasn't changed.

This makes the check in updateFrom() match the logic in diff().

Change-Id: I3ab4e8460f7fbf985ef55b9514a8aa90d401d486
Pie controls: Introducing a pie delivery service

To make pie controls more reliable, it is neccessary to detect
trigger actions directly from the input stream.
This commit introduces a new system service, that filters all
input events in front of the input dispatcher to detect pie activations.

This commit introduces:
* A new system server local API in the input manager service to register
  secondary input filters. These filters are behind the default
  accessibility filter but before the input event dispatching of
  the android framework.
* A new system service, that binds to the new API to listen for pie
  activation gestures.
* A non-public manager class providing access to the newly created pie
  service.

The service manager name of the service is "pieservice". The non-public
AIDL interface of the service is IPieService.aidl. To register a new
pie activation listener the INJECT_INPUT permission is needed. The
service state can be dumped by the "dumpsys pieservice" command.

Note: This commit only introduces the pie service. There is another
commit, that binds the actual pie controls to the pie service.

Patch Set #1:
* The pie service is currently disabled by default and needs to be
  enabled by device overlays (see config.xml / config_allowPieService).

Patch Set #2:
* Activation fixes
* Debug dump improvements

Patch Set #4:
* Added systrace support (TRACE_INPUT_TAG)
* Switch default to enable service on all devices.
* Moved Position to com.internal.android.utils.pie.*
* Some more code rearrangements

Patch Set #5:
* Rebase

Patch Set #6:
* Cover more corner cases on PieInputFilter
* Adjust gesture time out

Patch Set #7:
* Do not send events that are from the past
* Recycle all events

Patch Set #8:
* Handle binder died events in PieService correctly

Patch Set #10:
* Simplified locking
* SYSTEM_UI_FLAG_HIDE_NAVIGATION support
* Fixed ADW Lauchner bug

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Pie controls: A new way of activation

Based on "Pie controls: Introducing a pie delivery service" this
commit binds the pie controls to the newly created pie service.

Patch Set #2:
* Fixed glitch when displaying the search panel at the lock
  screen.

Patch Set #5:
* Switch Position to com.android.internal.util.pie.Position
* Removed legacy and unused code

Patch Set #6:
* Fixed lock screen glitch, finally!

Patch Set #7:
* Rebase

Patch Set #9:
* Moved almost all of the pie logic to PieController

Patch Set #10:
* Remove window completely from WindowManager when not shown

Patch Set #13:
* Fixed Taichi's bug
* Removed observers in PieView

Patch Set #14 & #15:
* Rebase

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Increase pie trigger time to 340, currently we have to swype too fast to get a trigger
Fix up notification LED behaviour

- Commit 5713307e3d2eb457ba148df3683ad09733727506 (in ICS) attempted to
  fix the problem that the notification LED wasn't reenabled after
  turning off the screen again, but introduced another bug in the
  process: If another pending notification with LED at the time when the
  notification with the new magic flag introduced by that commit (which
  was used by phone and MMS apps) was active, the LED still wouldn't be
  turned on at screen off time. Also, this commit didn't handle locking
  correctly.
  This commit essentially reverts 5713307e and makes sure the LED is
  reevaluated when the screen is turned off again.

- This change also makes the assignment of the LED when multiple pending
  notifications want to use the LED more clear: The notification with
  highest priority gets the LED. If multiple notifications with same
  priority exist, the most recent one gets the LED.

JIRA:CYAN-652
Change-Id: I1df0b40cca2af7a08c240677d22d2a95097b7184
Allow applications to show the navigation bar in expanded desktop mode.

This is used by the settings app to show the navigation bar when editing
it.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
NavigationBar : Only inflate once

Since the navbar now has updateResources(), there is no need to reinflate
it upon a theme change.

Change-Id: Ie4753a767a1cb45eb459ee692d16067f83cc7d23
SystemUI: Clean up old H+ drawables causing issues on manta

These drawables seem to be adapted to fit the old combined
tablet status bar. They mistakenly gets used on manta with
an oversized H+ drawable as a result.

Change-Id: Iefc0e997e31508ea98f10e5b399ce6569a4a3a44
Pie Controls: Fix snap points position.

This commit reverts an error, introduced by the second pie
service commit, which causes the positions where the snap points
gets displayed to be inverted.

Change-Id: Iedaf6d4773c9ae45fb685d724fad6c35ecdeddf0
Pie Controls: Fix sound effects.

After the pie service commits, sound effects were broken for
HOME and BACK keys.

This commit fixes this, by moving the play back of the sound
effect from the injection directly to the onClick().

Change-Id: Id59848ccddac20cef80500f6e72d76afa97ae093
Remove opaque check in GLRenderer when preparing dirty region.

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage to be present from the previous process in the color buffer.

CRs-Fixed: 391492, 403067, 405916

Change-Id: I1f72a3dee2f5d58a984f4cd367c9f7bf08ab9d6a

[PATCH] Remove opaque check in preparing dirty region

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new rocess. This prevents
garbage to be present from the previous process in the color buffer.

(cherry picked from commit 2b5e584e2615852b68a69bb529c6926190246b64)

Change-Id: I92a4fa35e0746f12fcd736e21fd30d9c4b644a8a
CRs-Fixed: 391492, 403067, 405916

Enable scissor when preparing dirty rect that is opaque

Now enabling scissor before setting it in the opaque case, previously was not doing so.

Change-Id: I1ea904cf01603096e423556090564291ab712d36
CRs-Fixed: 465346
Depends-on: 278453

Remove opaque check in preparing dirty region

Since preserve swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage being present from the previous process in the color buffer.

CRs-Fixed: 465346
Change-Id: I98f2009748244751c4b56af8afbdfeb645c13230
Fix layout of MultiWaveView and GlowPadView.

If the calculated size of the rings is much smaller than the measured
size (which is happening e.g. on mdpi 600x1024 tablets), the glow pad
appeared shifted to the right.
This happened due to the insets being calculated as difference of
available and needed size, and later on being added to the available
size. Example numbers (Nexus 4 with density forced to 160):
- computed size in onMeasure: 768x505
- scaled size in onMeasure: 505x505
- thus, insets are calculated as 131/0
- in onLayout, placementWidth (364) and max target width (108) are much
  smaller than width (768)
- thus, center is calculated as 131 + (768 / 2) = 515, thus shifted to
  the right

Fix that by not using width in the calculation, as the inset size
already takes it into consideration.

Change-Id: Ifc2a93214f812f554a8fed3243eed66aec9f00c9