I am making a flash light app. So naturally most devices now a days have a built in flash for the camera but when a flash is not present I want to use the screen as the flash light. To make this functionality work I want to adjust the screen brightness so it can act as the flashlight. To change the brightness I used code from this post. The code works fine and I can change the brightness without issue. As a side note this code I used works on Physical android 8.1, 10 and 11 devices.
My first question comes from a lint warning I get when adding the <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
permission. The warning says
"Permission is only granted to system apps". Now I can obviously just suppress this warning, but my worry is when I upload the app to the app store Google will either reject the AAB or the app will no longer be a "System app" once its downloaded from the app store. Will suppressing the error do anything?
My second question is is this a false positive? Looking at the manifest permission docs WRITE_SETTINGS
has no special permission besides for having to get the users consent buuuut WRITE_SECURE_SETTINGS
definitely does. As per the docs for WRITE_SECURE_SETTINGS
"Allows an application to read or write the secure system settings. Not for use by third-party applications." So could this be lint thinking WRITE_SETTINGS
is WRITE_SECURE_SETTINGS
?