Post AQp9Sf5dCS30qMl2Ku by MishaalRahman@androiddev.social
 (DIR) More posts by MishaalRahman@androiddev.social
 (DIR) Post #AQp9Sf5dCS30qMl2Ku by MishaalRahman@androiddev.social
       2022-12-20T01:05:25Z
       
       0 likes, 0 repeats
       
       Now that Android 13 added a standard API for controlling the flashlight brightness, I'd love to see the Quick Setting tile be updated to become a slider rather than just a toggle, as shown in this GIF. Would be a nice QOL feature!Credits: Anirudh Gupta
       
 (DIR) Post #AQp9Sfiyq9WUoPASfY by MishaalRahman@androiddev.social
       2022-12-20T01:05:59Z
       
       0 likes, 0 repeats
       
       For some context, Android 13 added an API that apps can call to programmatically set the brightness of the flashlight (https://blog.esper.io/android-13-deep-dive/#flashlight_brightness).Apps used to need root to do this on some devices (eg. writing to /sys/class/leds) or use an API only available on some OEM forks.In the new camera HAL version introduced with Android 13, there's a method to turn on the torch at a certain strength level (https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/master/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl#322). If this isn't implemented, the corresponding Android API won't work.
       
 (DIR) Post #AQp9SgBh7OUYFSbOQS by chester_tan@sigmoid.social
       2022-12-20T20:38:19Z
       
       0 likes, 0 repeats
       
       @GrapheneOS is the team planning to add this feature?
       
 (DIR) Post #AQp9SgZnflm3SDse00 by GrapheneOS@grapheneos.social
       2022-12-21T07:13:32Z
       
       0 likes, 0 repeats
       
       @chester_tan We don't have to add anything. It will already be supported on devices where it's available.
       
 (DIR) Post #AQp9SkJzkTVZ4MW4v2 by MishaalRahman@androiddev.social
       2022-12-20T01:06:41Z
       
       0 likes, 0 repeats
       
       Few devices have shipped an updated camera HAL when upgrading to Android 13, though, as Google Requirements Freeze (GRF) makes it so the chipset's vendor implementation doesn't need to be updated with each Android release (https://blog.esper.io/android-dessert-bites-11-grf-323579/).Eg. the Zenfone 9 and Nothing Phone 1 don't support this feature 😢.
       
 (DIR) Post #AQp9SmOg22RRVSiqUi by MishaalRahman@androiddev.social
       2022-12-20T01:07:20Z
       
       0 likes, 0 repeats
       
       You can check for yourself with the "Flashlight Tiramisu" app on GitHub/F-Droid: https://github.com/polodarb/Flashlight-TiramisuAlternatively, you can also check the VINTF manifest on your device. The Zenfone 9 implements the legacy HIDL HAL, for example.
       
 (DIR) Post #AQp9SoWu6QD87YaRay by MishaalRahman@androiddev.social
       2022-12-20T01:08:12Z
       
       0 likes, 0 repeats
       
       Google has implemented this feature, at least on the Pixel 6 and later. The camera HAL on Pixels is part of an APEX module in /vendor. (Ignore the filename because it's not the legacy HIDL HAL - that's apparently done to avoid breaking something.)StatiXOS implemented this feature in their latest build: https://github.com/StatiXOS/android_packages_apps_Statix_SystemUI/commit/abced48edf676c04340344d970ff642d1383865bAnd an Xposed module called AOSPMods also implements it if you're on Pixel: https://github.com/siavash79/AOSPMods/blob/canary/app/src/main/java/sh/siava/AOSPMods/systemui/FlashLightLevel.javaI'd love to see this in a future Android 13 QPR on supported Pixels!