summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-07-07 22:07:58 +0200
committerGerrit Code Review <gerrit2@gerrit>2014-07-09 15:55:56 +0200
commita18f108e8439c2b1d564f30634eeb8b51a0dbfa2 (patch)
tree4504092bf9695bb5b281bdaff9e4377cd393aa18 /data.cpp
parentTrack backup and restore progress (diff)
downloadandroid_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar.gz
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar.bz2
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar.lz
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar.xz
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.tar.zst
android_bootable_recovery-a18f108e8439c2b1d564f30634eeb8b51a0dbfa2.zip
Diffstat (limited to 'data.cpp')
-rw-r--r--data.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/data.cpp b/data.cpp
index 39f24c13e..79d3f78f9 100644
--- a/data.cpp
+++ b/data.cpp
@@ -51,6 +51,10 @@
#include "cutils/properties.h"
#endif
+#ifndef TW_MAX_BRIGHTNESS
+#define TW_MAX_BRIGHTNESS 255
+#endif
+
extern "C"
{
#include "twcommon.h"
@@ -946,9 +950,6 @@ void DataManager::SetDefaultValues()
mValues.insert(make_pair("tw_gui_done", make_pair("0", 0)));
mValues.insert(make_pair("tw_encrypt_backup", make_pair("0", 0)));
#ifdef TW_BRIGHTNESS_PATH
-#ifndef TW_MAX_BRIGHTNESS
-#define TW_MAX_BRIGHTNESS 255
-#endif
string findbright;
if (strcmp(EXPAND(TW_BRIGHTNESS_PATH), "/nobrightness") != 0) {
findbright = EXPAND(TW_BRIGHTNESS_PATH);
@@ -975,6 +976,8 @@ void DataManager::SetDefaultValues()
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)));
+ string max_bright = maxVal.str();
+ TWFunc::write_file(findbright, max_bright);
}
#endif
mValues.insert(make_pair(TW_MILITARY_TIME, make_pair("0", 1)));
@@ -1136,13 +1139,12 @@ void DataManager::ReadSettingsFile(void)
#endif // ifdef TW_OEM_BUILD
PartitionManager.Mount_All_Storage();
update_tz_environment_variables();
-#ifdef TW_MAX_BRIGHTNESS
- if (strcmp(EXPAND(TW_BRIGHTNESS_PATH), "/nobrightness") != 0) {
- string brightness_path = EXPAND(TW_BRIGHTNESS_PATH);
+
+ string brightness_path = GetStrValue("tw_brightness_file");
+ if (!brightness_path.empty() && brightness_path != "/nobrightness" && TWFunc::Path_Exists(brightness_path)) {
string brightness_value = GetStrValue("tw_brightness");
TWFunc::write_file(brightness_path, brightness_value);
}
-#endif
}
string DataManager::GetCurrentStoragePath(void)