diff options
author | Greg Wallace <greg@gregtwallace.com> | 2015-11-08 19:54:25 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2015-12-23 19:30:24 +0100 |
commit | 36ade45b1bfb69272d6a2f190ef5570d4da9310a (patch) | |
tree | bddbb433466fdf235edb0ecdbd786df7db0c1e96 /data.cpp | |
parent | Changed off_t to loff_t (diff) | |
download | android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar.gz android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar.bz2 android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar.lz android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar.xz android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.tar.zst android_bootable_recovery-36ade45b1bfb69272d6a2f190ef5570d4da9310a.zip |
Diffstat (limited to '')
-rw-r--r-- | data.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -865,8 +865,24 @@ void DataManager::SetDefaultValues() LOGINFO("Specified secondary brightness file '%s' not found.\n", secondfindbright.c_str()); } #endif - string max_bright = maxVal.str(); - TWFunc::Set_Brightness(max_bright); +#ifdef TW_DEFAULT_BRIGHTNESS + int defValInt = TW_DEFAULT_BRIGHTNESS; + int maxValInt = TW_MAX_BRIGHTNESS; + // Deliberately int so the % is always a whole number + int defPctInt = ( ( (double)defValInt / maxValInt ) * 100 ); + ostringstream defPct; + defPct << defPctInt; + mValues.erase("tw_brightness_pct"); + mValues.insert(make_pair("tw_brightness_pct", make_pair(defPct.str(), 1))); + + ostringstream defVal; + defVal << TW_DEFAULT_BRIGHTNESS; + mValues.erase("tw_brightness"); + mValues.insert(make_pair("tw_brightness", make_pair(defVal.str(), 1))); + TWFunc::Set_Brightness(defVal.str()); +#else + TWFunc::Set_Brightness(maxVal.str()); +#endif } #endif mValues.insert(make_pair(TW_MILITARY_TIME, make_pair("0", 1))); |