Framework: Enable Speaker on Proximity (1/3)

restoring abandoned commit from:
    https://gerrit.slimroms.net/#/c/15838/

Change-Id: If5ecd637d1dc5d2ce0bcca8b0cfeb1c25a753703
SystemUI: Fix crash during notification/theme change

Fixes crashing that could occur when a notification is created
during a theme change. Entries were attempting to be added
to views which did not have a layout pass yet, causing it to fail.

When a theme change occurs, the fix is to halt the ticker and command queue
until a layout occurs.

BUGDUMP-151925

Change-Id: Ic19d26178df673a1d52981a8617415e6fbcb219d

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Fix Cherry-pick Derp
[Base] Ability to turn HW keys on/off on supported devices (1/2)

- Enabled through overlay in devices repo

Change-Id: I5ca53bf60482392298c7ab6de3efe17abf20b2b9

Conflicts:
	core/java/android/provider/Settings.java
	core/java/android/view/ViewConfiguration.java
	core/res/res/values/cr_config.xml
	core/res/res/values/cr_symbols.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Avoid SysUI force closing when enable/disable DSB System bar gradient option

Change-Id: I5d6dcea9f4d7187a9c14d8ef0dd5c1c874cb8d9f
Revert "[Base] Ability to turn HW keys on/off on supported devices (1/2)"

This reverts commit babbcbfcae41ffac44e7c1e0a229dd901ae883de.
DSB: Set battery text paint for percent to black

Conflicts:
	packages/SystemUI/src/com/android/systemui/BatteryMeterView.java

Change-Id: Ib14dd160e446b9867143687231b3f58b1f784569
Delete media tests

Media files take up a lot of spce. Deleting them cuts the size of frameworks
almost in half.

Change-Id: I3fd1019df8b41404909b7b4df8ad709526ceff36
Signed-off-by: Evan Anderson <evan1124@gmail.com>
Revert "DSB: Set battery text paint for percent to black"

This reverts commit f294107eb363d5e3d870f913269a762a12e2ef8a.
add framework torch service

Change-Id: I0c7a055b33fdebe697f23d207b20408e06eb74a8
Signed-off-by: Roman Birg <roman@cyngn.com>
Fully fix interaction between torch and camera usage.

For doing this, two things are necessary:
- The torch shutdown needs to be synchronous, so that the torch app has
  a chance to release the camera before the camera app tries to use it.
- The torch service needs to track camera usage, so that it can notify
  the torch app if a camera is busy.

Change-Id: I521091d255ff4c251d97a0e8d65c9d2a80b9dae4
Fix camera usage tracking.

When a Camera object is finalized, it notifies the torch service that
it's no longer using the camera. This call used to not check whether the
caller actually is still using the camera and called release() before,
so depending on timing of the finalizer, it could happen that e.g. the
camera app released the camera user record of the torch app, leading to
the torch usage not being detected on next usage of the camera app.

Fix that by checking whether the caller of onCameraClosed() actually
owned the camera prior to releasing the record.
Also fix synchronization between accesses.

Change-Id: Ic01cbc3c89ab8d855e4613bfa1b2f548de919b73
frameworks: extend TorchService to be able to handle sysfs torch config

Some devices are still using a sysfs node to control the torch. Let's
support those configurations and properly shut the torch down.

Change-Id: I5fa1cccdcffad26dbfef4b2ee0eafe1218a5308b
Signed-off-by: Roman Birg <roman@cyngn.com>
Merge remote-tracking branch 'upstream/kk4.4' into kk4.4