From 98fc399c2660727a6bde66e1a51e8460aaf3c7e7 Mon Sep 17 00:00:00 2001 From: nkk71 Date: Sat, 16 Dec 2017 16:26:42 +0200 Subject: Use /persist as Qualcomm time fix source during early boot * /persist can be mounted early while TWRP is parsing the fstab so as soon as the partition is parsed, mount and adjust the time accordingly. * Store a backup settings file on /persist. Having a 2nd copy of the settings file in the /persist partition allows for early reading of the file and adjust timezone and brightness to user preference while still on TWRP splash. * Add the qcom ats time offset in TWRP settings file and use it if no better ats file is found. This will also allow devices with a persist partition, but no ats files in it, to adjust the time offset during early boot. * Use /persist/time/ as Qualcomm time fix source, based on Xuefer patch: https://gerrit.omnirom.org/c/27265/ https://gerrit.omnirom.org/c/24384/ Change-Id: I6c21538eec58d87edfb639d9ce3871f33b886c1d --- data.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'data.hpp') diff --git a/data.hpp b/data.hpp index 790efc993..d61fe8e7c 100644 --- a/data.hpp +++ b/data.hpp @@ -23,6 +23,8 @@ #include #include "infomanager.hpp" +#define PERSIST_SETTINGS_FILE "/persist/.twrps" + using namespace std; class DataManager @@ -30,13 +32,14 @@ class DataManager public: static int ResetDefaults(); static int LoadValues(const string& filename); + static int LoadPersistValues(void); static int Flush(); // Core get routines static int GetValue(const string& varName, string& value); static int GetValue(const string& varName, int& value); static int GetValue(const string& varName, float& value); - static unsigned long long GetValue(const string& varName, unsigned long long& value); + static int GetValue(const string& varName, unsigned long long& value); // Helper functions static string GetStrValue(const string& varName); -- cgit v1.2.3