diff --git a/app/src/main/java/com/jens/automation2/Actions.java b/app/src/main/java/com/jens/automation2/Actions.java index 4ea194f..be71ba6 100644 --- a/app/src/main/java/com/jens/automation2/Actions.java +++ b/app/src/main/java/com/jens/automation2/Actions.java @@ -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); }