Frameworks: rework navbar and statusbar transparency/color handling (1/2)

All current implemented versions of nav and statusbar transparency
which are around are not really perfect and all have downsides. After I saw the
implementation from Romanb (thanks) I got an idea to solve especially
the problem on keyguard without forcing the user to set for keyguard
seperatly a transparency to have a good result. Main problem is that
aosp does not allow to overlay the navbar with a shadow.

This commit does:

- introduce central TransparencyManager (thanks Roman)
- introduce a layerDrawable with a ColorDrawable as overlay and underlay
  to get consistent results on keyguard to show the shadow
- introduce a overlay to animate the navbar shadow like the PIE background shadow
  when the user is not in expanded mode. So the user get the whole screen darken (or colored).
- get complete rid of backgroundalphadrawable class
- allow colorize of theme (theme engine) navbar/status bar background changes
  reset to default shows as usual the theme without manipulation
- expand the custom background area on lockscreen behind the statusbar
  (navbar AOSP does not allow)

- default wallpaper and full transparent mode is now completly consistent and nice
  looking on every possible setting.
- full color lockscreen reflects the color now behind the navbar
  to imitate same behaviour like the default wallpaper on lockscreen. As well
  now consistent and nice looking on every possible setting.
- lockscreen background image mode is the only one where a 100% consistent solution
  is not possible due that the image is always smaller on lockscreen (not expandable behind
  navbar) and I do not see a good way to put in the underlay a partly image in a nice way
  ...to avoid weird transparency draws the transparency on navbar
  is set to the chosen lockscreen background transparency as long the lockscreen transparency
  is smaller then the navbar/statusbar transparency. Todo: notify in settings the user about
  the behaviour change so that it is no surprise.
- add multiuser compatibility to serveral vars
- margin fix on lockscreen
- hide statusbar on lockscreen on expanded or autohide statusbar mode
- add option to unlink colorizing on apps
- optimizing and a memory leak fix
- cleanup

Change-Id: I22ccfc5d3fff58b266848b2e0983435094ba6847

Conflicts:

	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/config.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
Frameworks: move complete keyevents into SlimActions

still to lazy to doe the HW key rebinding revamp but we need
this move as well for that and it is from codeview much cleaner

This commit does:
- move all key event actions into SlimActions
- get rid off ExtensableKeyViewButton class and handle all over
  the AOSP KeyViewButton class which is now reverted nearly to the aosp
  one with slight modifications for the key handling
- fix the double vibrations on home, back and recents
- fix double sound on menu action on PIE and navbar permanent menu buttons
  due that the click sound is played by PhoneWindow.java for ActionBar events
  we do not play our sound for this action
- cleanup a lot unused imports

Change-Id: I7f1862e0e43654837fce4f4085d1ab9aef0558df

Conflicts:
	core/java/com/android/internal/util/cm/SlimActions.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensibleKeyButtonView.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
Frameworks: add Accessibility events to navbar, pie and navring

for click and longpress actions

Change-Id: Iea536ec43cbad9f2c26e0ab52a89f7d2c700f149
Framewors: add expanded dektop to SlimActions (1/2)

which is then available for PIE, navbar and navring and later
for HW keys

Change-Id: I00ebf30c75aa1b2980c2e41ce1464ee5b63e6f83

This commit also contains some missing changes of acess notification from navigation bar
Frameworks: add power menu to SlimActions (1/2)

like the feature before we can see now how easy the util
class and the dlsv is for us to use....just 8 lines + drawables
and we have a new feature available on all navigations

Change-Id: I88b5d5ded06294824679b0850725f14240c2ef92

Conflicts:
	core/java/com/android/internal/util/cm/ButtonsConstants.java
	packages/SystemUI/src/com/android/systemui/SearchPanelView.java
Frameworks: add DeviceSupportUtils helper class

adapted partly from cm (thanks) + own modification for our needs.
Currently unused but there will follow a bunch of commits which will
use it next days

Change-Id: Ifc0c1353e1d65ead000d07e2eab2ed7d8eaa1894
Framweworks: add filter method for supported phone features

which will be later used for any settings arrays which need to be
filtered out.

Change-Id: Ifc941a8e0834526b1fa95843beee2c6eafe2e120
Frameworks: add torch to SlimActions

can't sleep so will do the easy things on the todo list lol

Change-Id: I3aef8f2133350b87a78707b9392123947425f8e5

Conflicts:
	core/java/com/android/internal/util/cm/ButtonsConstants.java
	core/java/com/android/internal/util/cm/ButtonsHelper.java
Frameworks: fix defaulte transparency value

Change-Id: I32fec3cc87990574b6a46aa4c3367a4a3f330c4e
Frameworks: fix typo

Change-Id: I58dc2bc1e510101f0c180be34442722c90cc9a57
Prevent nullPointerException by updateBondedBluetoothDevices

In some very rare cases difficult to identify, it seems that the
IBluetooth.getBondedDevices() returns a Set with a null element.

This patch will prevent calling getBondState() if the device is null to
avoid a nullPointerException.

Change-Id: I9bcad60c37e03c77ec39227e5c947c002a3ae2c7
Orig-Change-Id: I8845f0e6b8fdcda679bc71e2b5c33fd4a52f3ac5
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/116592
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 90085
Frameworks: fix possible NPE on SlimPIE

some activity chooser (from launchers) give the user choices which do not
exist and would give back a null drawable. To prevend the NPE
check the drawable for null

Change-Id: I3c2c1e1ddff32b383f1ee24e41de22a9a4524ff3
Frameworks: dynamic PIE menu button + navbar menu logic cleanup (1/2)

at least the whole menu button stuff is from android version to android
version more depreciated and will go more and more away. So let us do it
like google:

- clean up the messy old AOKP navbar menu code
- make it only selectable when the menu button is really there
  and not as well when it is completly hidden
- remove the menu button action with big icon due off redundancy
- switch between modes: default jb (shows only on request), always and none
- All the above as well now in PIE...small button in first row is added
  same selectable modes for the menu lover lol
- smaller adjustments
- settings adjustments

Change-Id: Ie383843990ea40e52ef2fbe90401a3c38375d740

Conflicts:

	core/java/android/provider/Settings.java
	packages/SystemUI/res/drawable-hdpi/ic_sysbar_menu_big.png
	packages/SystemUI/res/drawable-mdpi/ic_sysbar_menu_big.png
	packages/SystemUI/res/drawable-xhdpi/ic_sysbar_menu_big.png
	packages/SystemUI/src/com/android/systemui/statusbar/policy/PieController.java
Fix Appbar + removed unused nav code
Frameworks: bring navring/pie/navbar vibrate/sound inline with AOSP

currently all 3 features are doing it a bit different. For navigation
AOSP has for normal click:

 short soft vibrate + click sound

for longpress

 no sound but more intensive vibrate

This commit does:
- seperate keyevents haptic and sound from the other actions and call them
- add vibrate and sound to navring
- navbar only vibrate when the action is performing
- do not use custom vibrate on keycodes
- bring all inline with AOSP like described above
- fix a possible NPE on lockcreen

not solveable (do not ask me...google is not always consistent especially
on keyevents) due the change will break other global behaviours:
- menu button always have a click sound even on longpress.
- powermenu always have a second vibrate due of GlobalManager

all other works inline like described

Change-Id: I90fae2393c5c654055014556b0772447313d28b4
Allow theming of lockscreen

Change-Id: I10799482e0b393746b4c9818f94862109fac6006