As you can see in my blocks, I tried to set different values.
The brightness doesn’t change at all.
Did you grant the write settings permission?
I tested it with Companion and this permission is already granted (in Companion):
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
What will happen if you set the Brightness to 0?
As I said:
And you should grant it with call Screen.Open System Write Settings
Just tested it in my Virtual Pixel Phone and on my personal phone, it worked when the permission is granted. The get brightness will always work no matter the Write Settings are granted.
Here is a test aia: TestBrightnessTools.aia (25.2 KB)
Ah, you should grant it after opening System Write Settings → call Screen.Open System Write Settings
.
I tried it on another device beforehand and it worked without opening the System Write Settings (obviously it was already granted there).
Thanks.
You should add these blocks to the extension description:
Thanks for reminding! I will definitely add that
If i want to return brightness
what i do
BrightnessTools.Brightness
Could you please give a working example to return the screen brightness to what it was
the block he showed returns the current brightness
you might want to store the previous brightness in a variable to be able to set it back later
Taifun
any way , how i can do it ?
how many times to tell see this block
You do not understand what I mean
I want when the user presses the 1 button it increases the brightness level to the maximum
When pressing the button 2, it returns the brightness level to what it was.
Could I do it like this?
it looks like you have overseen this suggestion
Taifun
It’s really an awesome extension!!