As you probably noticed, Phone.SetScreenBrightness does not change the screen brightness but the brightness of the current window. Here is a library that allows to change the screen brightness and select the brightness mode (automatic/manual). It allows also to change the window brightness.
Example:
Example:
B4X:
'Sets the maximum brightness
Dim B As Brightness
B.SetScreenBrightnessMode(B.MODE_MANUAL)
B.SetScreenBrightness(255)