Screen brightness
This commit is contained in:
@ -65,6 +65,7 @@ import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.security.KeyStore;
|
||||
import java.text.Normalizer;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
@ -281,9 +282,8 @@ public class Actions
|
||||
Miscellaneous.logEvent("i", "Wifi", "Changing wifi to " + String.valueOf(desiredState) + ", but with root permissions.", 4);
|
||||
|
||||
String command = null;
|
||||
int state = 0;
|
||||
|
||||
String desiredStateString;
|
||||
String desiredStateString;
|
||||
if(desiredState)
|
||||
desiredStateString = "enable";
|
||||
else
|
||||
@ -2058,6 +2058,21 @@ public class Actions
|
||||
if(actualBrightnessValue == 0)
|
||||
actualBrightnessValue = 1; // seems to be the minimum, 0 isn't working
|
||||
|
||||
// try
|
||||
// {
|
||||
// for (int i = 1; i < 255; i++)
|
||||
// {
|
||||
// android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
// Thread.sleep(1000);
|
||||
// Log.i("Brightness", "Set: " + String.valueOf(i) + ", result: " + String.valueOf(android.provider.Settings.System.getInt(context.getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, -1)));
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
|
||||
Miscellaneous.logEvent("i", "Screen brightness", "Setting screen brightness to " + String.valueOf(actualBrightnessValue), 4);
|
||||
android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, actualBrightnessValue);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user