MobileNews

Android 13 adds native support for flashlight brightness, here’s how it works [Video]

For years now, iPhones and even Samsung’s Android smartphones have supported the ability to adjust the brightness of the LED flashlight on the back of your phone. Now, in Android 13, Google is finally delivering this ability to adjust flashlight brightness natively, and we’ve been able to try it out.

Google has added two new APIs to Android 13. “getTorchStrengthLevel” and “turnOnTorchWithStrengthLevel” fall under the “CameraManager” class and enable both the system and apps to control the flashlight at various levels. That’s in contrast to how things used to be, with Android only allowing for an on/off toggle.

This functionality is already live and working in Android 13, and our Dylan Roussel was able to work up a quick demo to show it in action on a Pixel 6 (courtesy of Damien Wilde, who was running the preview on his Pixel 6). In his basic demo app, we can change the intensity of the flashlight according to a slider, with “0” turning the flashlight off entirely in our demo. A more fleshed-out implementation of this could offer an actual toggle alongside the slider.

As it stands today, Android 13’s native flashlight toggle is still just that, an on/off toggle. But it’s not hard to imagine that, in the future, Google will allow the brightness to be adjusted on this toggle. Samsung implements that option using a long-press of the toggle in its quick settings menu.

As the folks over at Esper point out, though, this might not work on all devices running Android 13. “CameraCharacteristics.FLASH_INFO_STRENGTH_MAXIMUM_LEVEL” determines the highest setting the flashlight can be set to, in turn also determining how granular the setting can be.

In practice, here’s what that means. If a device only has a maximum level of “1,” then it would only work as an on/off toggle instead of controlling brightness, whereas a device with a maximum level of “128,” such as the Pixel 6 Pro, would support many levels of brightness control. Another device with a maximum level of “10” would hit the same maximum brightness as the device with 128, but it wouldn’t feature same granular level of control, with bigger jumps between each brightness setting. Samsung, notably, only supports 5 levels of brightness on devices such as the Galaxy S22+.

Notably, the Pixel 6 and Pixel 6 Pro have HAL (hardware abstraction layer) support for these new APIs in place in the Android 13 Developer Preview, but we weren’t able to use our test app on the Pixel 5 or Pixel 4 XL because those devices lack support. Version 3.8 of ICameraDevice is needed to support this feature in Android 13.

Unfortunately, this needed upgrade probably means that many devices being upgraded to Android 13 won’t support changing the brightness of the flashlight, as updating “ICameraDevice” is not something Google currently requires. Devices launching with Android 13, though, will support the feature and it’s entirely possible that Google will add support on Pixels being upgraded to Android 13 (Pixel 4 and newer).

Dylan Roussel and Damien Wilde contributed to this article

More on Android 13:


Check out the latest Samsung phones at great prices from Gizmofashion – our recommended retail partner.


Author: Ben Schoon
Source: 9TO5Google

Related posts
AI & RoboticsNews

Nvidia and DataStax just made generative AI smarter and leaner — here’s how

AI & RoboticsNews

OpenAI opens up its most powerful model, o1, to third-party developers

AI & RoboticsNews

UAE’s Falcon 3 challenges open-source leaders amid surging demand for small AI models

DefenseNews

Army, Navy conduct key hypersonic missile test

Sign up for our Newsletter and
stay informed!