问题
I am porting an existing iOS app to Android. In a special use case, the (iOS) app uses the flashlight to indicate different states of a progress to the user (as the screen must be facing down). It is switched on just for approx. 3 seconds for two times. To make clear the progress even more / make it easier to differ, we want the intensity/brightness of the flashlight to be lower / higher between the states. The iOS app does that, but there seems to be no official or reliable way to control the intensity of the flashlight on Android. I read about a hacky way to set the brightness value by writing to "sys/class/leds/flashlight/brightness" or alternatively "/sys/devices/platform/flashlight.0/leds/flashlight/brightness". As my Galaxy S4 does not have these files (and so probably many other devices), this solution also doesn't solve my problem. Anyone solved that kind of problem or has a hint?
Thanks.
UPDATE: I'm looking for a reliable solution that works on unrooted devices.
来源:https://stackoverflow.com/questions/20701937/is-the-flashlight-intensity-brightness-controllable-on-android