Torch Strength Control

For devices running Android 13 or higher, the Android framework provides a multilevel control for torch strength. In Android 12 and lower, the framework allows only for turning the torch mode on or off. By supporting multilevel torch strength control, devices can enable use cases such as controlling the brightness of the flashlight based on lighting conditions and sending signals for assistance using a strobe effect by sending quick pulses of light in a row. Another benefit of this feature is that it can improve battery life and performance as the torch mode doesn't always need to be turned on at the maximum strength, which can lead to thermal throttling conditions.

Public APIs

Apps can use the torch strength control feature through the following public APIs and camera characteristics keys. No camera permissions are required for these APIs because the camera isn't accessed.

CameraManager APIs

CameraCharacteristics keys

Implementation

To support the torch strength control feature on your device, use the following camera AIDL HAL interfaces:

Location: /camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl

Ensure your HAL implementation advertises the following camera characteristics keys to support the torch brightness control feature:

For a reference Camera HAL implementation supporting torch strength control, see EmulatedCameraDeviceHWLImpl.cpp.

Validation

To validate your implementation of the torch strength control feature, run the following VTS and CTS tests: