summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2013-04-01 22:11:33 +0200
committerDees_Troy <dees_troy@teamw.in>2013-04-04 20:59:08 +0200
commit85932344cd9a84d8586b4f9839855c730c8e8ebc (patch)
treeced1604b4e8baf7b711ebc4f30c3f15ead4ff67a /gui/action.cpp
parentMove all AOSP code out of recovery binary (diff)
downloadandroid_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.gz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.bz2
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.lz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.xz
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.tar.zst
android_bootable_recovery-85932344cd9a84d8586b4f9839855c730c8e8ebc.zip
Diffstat (limited to '')
-rw-r--r--gui/action.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index b35074cf0..64049b2c1 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")