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 <xuefer@gmail.com> patch:
https://gerrit.omnirom.org/c/27265/
https://gerrit.omnirom.org/c/24384/
Change-Id: I6c21538eec58d87edfb639d9ce3871f33b886c1d
diff --git a/data.hpp b/data.hpp
index 790efc9..d61fe8e 100644
--- a/data.hpp
+++ b/data.hpp
@@ -23,6 +23,8 @@
#include <pthread.h>
#include "infomanager.hpp"
+#define PERSIST_SETTINGS_FILE "/persist/.twrps"
+
using namespace std;
class DataManager
@@ -30,13 +32,14 @@
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);