diff --git a/Android.mk b/Android.mk
index 398eac7c..88066168 100644
--- a/Android.mk
+++ b/Android.mk
@@ -303,7 +303,6 @@ include $(commands_recovery_local_path)/libjpegtwrp/Android.mk \
$(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \
$(commands_recovery_local_path)/crypto/cryptfs/Android.mk \
$(commands_recovery_local_path)/libcrecovery/Android.mk \
- $(commands_recovery_local_path)/twmincrypt/Android.mk \
$(commands_recovery_local_path)/libblkid/Android.mk \
$(commands_recovery_local_path)/minuitwrp/Android.mk
diff --git a/data.cpp b/data.cpp
index 9c60eddc..867c289c 100644
--- a/data.cpp
+++ b/data.cpp
@@ -470,7 +470,6 @@ int DataManager::SetValue(const string varName, int value, int persist /* = 0 */
str = GetStrValue(TW_EXTERNAL_PATH);
SetValue("tw_storage_path", str);
- SetBackupFolder();
}
return SetValue(varName, valStr.str(), persist);
}
@@ -909,26 +908,19 @@ void DataManager::SetDefaultValues()
mValues.insert(make_pair("tw_military_time", make_pair("0", 1)));
mValues.insert(make_pair("tw_screen_timeout_secs", make_pair("60", 1)));
mValues.insert(make_pair("tw_gui_done", make_pair("0", 0)));
-#ifdef TW_MAX_BRIGHTNESS
+#ifdef TW_BRIGHTNESS_PATH
+#ifndef TW_MAX_BRIGHTNESS
+#define TW_MAX_BRIGHTNESS 255
+#endif
if (strcmp(EXPAND(TW_BRIGHTNESS_PATH), "/nobrightness") != 0) {
LOGINFO("TW_BRIGHTNESS_PATH := %s\n", EXPAND(TW_BRIGHTNESS_PATH));
mConstValues.insert(make_pair("tw_has_brightnesss_file", "1"));
mConstValues.insert(make_pair("tw_brightness_file", EXPAND(TW_BRIGHTNESS_PATH)));
- ostringstream val100, val25, val50, val75;
- int value = TW_MAX_BRIGHTNESS;
- val100 << value;
- mConstValues.insert(make_pair("tw_brightness_100", val100.str()));
- value = TW_MAX_BRIGHTNESS * 0.25;
- val25 << value;
- mConstValues.insert(make_pair("tw_brightness_25", val25.str()));
- value = TW_MAX_BRIGHTNESS * 0.5;
- val50 << value;
- mConstValues.insert(make_pair("tw_brightness_50", val50.str()));
- value = TW_MAX_BRIGHTNESS * 0.75;
- val75 << value;
- mConstValues.insert(make_pair("tw_brightness_75", val75.str()));
- mValues.insert(make_pair("tw_brightness", make_pair(val100.str(), 1)));
- mValues.insert(make_pair("tw_brightness_display", make_pair("100", 1)));
+ ostringstream maxVal;
+ maxVal << TW_MAX_BRIGHTNESS;
+ mConstValues.insert(make_pair("tw_brightness_max", maxVal.str()));
+ mValues.insert(make_pair("tw_brightness", make_pair(maxVal.str(), 1)));
+ mValues.insert(make_pair("tw_brightness_pct", make_pair("100", 1)));
} else {
mConstValues.insert(make_pair("tw_has_brightnesss_file", "0"));
}
diff --git a/gui/Android.mk b/gui/Android.mk
index 748c5ec8..35d877bc 100644
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -17,6 +17,7 @@ LOCAL_SRC_FILES := \
animation.cpp \
conditional.cpp \
slider.cpp \
+ slidervalue.cpp \
listbox.cpp \
keyboard.cpp \
input.cpp \
@@ -52,6 +53,11 @@ endif
ifneq ($(TW_BRIGHTNESS_PATH),)
LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=$(TW_BRIGHTNESS_PATH)
endif
+ifneq ($(TW_MAX_BRIGHTNESS),)
+ LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS)
+else
+ LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255
+endif
ifneq ($(TW_NO_SCREEN_BLANK),)
LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK
endif
diff --git a/gui/action.cpp b/gui/action.cpp
index b35074cf..64049b2c 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -540,6 +540,33 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
DataManager::SetValue(varName, value);
return 0;
}
+ if (arg.find("*") != string::npos)
+ {
+ string varName = arg.substr(0, arg.find('*'));
+ string multiply_by_str = gui_parse_text(arg.substr(arg.find('*') + 1, string::npos));
+ int multiply_by = atoi(multiply_by_str.c_str());
+ int value;
+
+ DataManager::GetValue(varName, value);
+ DataManager::SetValue(varName, value*multiply_by);
+ return 0;
+ }
+ if (arg.find("/") != string::npos)
+ {
+ string varName = arg.substr(0, arg.find('/'));
+ string divide_by_str = gui_parse_text(arg.substr(arg.find('/') + 1, string::npos));
+ int divide_by = atoi(divide_by_str.c_str());
+ int value;
+
+ if(divide_by != 0)
+ {
+ DataManager::GetValue(varName, value);
+ DataManager::SetValue(varName, value/divide_by);
+ }
+ return 0;
+ }
+ LOGERR("Unable to perform compute '%s'\n", arg.c_str());
+ return -1;
}
if (function == "setguitimezone")
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 1615ee9c..b24bda38 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -197,6 +197,14 @@
+
+
+
+
+
+
+
+
@@ -2289,100 +2297,47 @@
Screen Settings
-
-
-
-
-