Revert "Add CM Torch compatibility"

This reverts commit 6b76ab490d1fd6723b51fa5f18675bbae717b6c4.

Change-Id: I26f9788f66beb6c9b04147a76d94249e45e21d9f
Revert "[1/2] Base: Update Torchaction to our action"

This reverts commit 07e3a5865330be722719748bb8511d2261253de0.

Conflicts:
	core/java/com/android/internal/util/cm/NavigationRingHelpers.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	packages/SystemUI/AndroidManifest.xml

Change-Id: I1506ec087ee72159b53bfc1620b6bda17309736e
Revert "Base: update Torch tile to NamelessRom"

This reverts commit 4ff07ff151bbc1396b847d3272cda057620d50a4.

Change-Id: I71596d92f71215dd5b85f63f70e71694e4f50c91
modify glowpad torch to use the new Torch

Change-Id: If4b407b946781573ae326e6d849bbb88fe742972
Revert "utils: contants: introduce FlashLightConstants"

This reverts commit fc4004499a71b75013df00045227c11a3850b7c2.

Change-Id: If7d90b760930091dc61f04c02f20c822d5606556
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
SystemUI: fix torch toggle delay on boot

Change-Id: I7b1a1a310cf88fdde4250ae40643570016e1f380
Signed-off-by: Roman Birg <roman@cyngn.com>
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>
fixups

Change-Id: I82c90d48d96459a9098e55c4a57038358be6322a