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/twrp-functions.hpp b/twrp-functions.hpp
index 9c149ea..a1f67f2 100644
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -88,7 +88,7 @@
 	static string System_Property_Get(string Prop_Name);                // Returns value of Prop_Name from reading /system/build.prop
 	static string Get_Current_Date(void);                               // Returns the current date in ccyy-m-dd--hh-nn-ss format
 	static void Auto_Generate_Backup_Name();                            // Populates TW_BACKUP_NAME with a backup name based on current date and ro.build.display.id from /system/build.prop
-	static void Fixup_Time_On_Boot(); // Fixes time on devices which need it
+	static void Fixup_Time_On_Boot(const string& time_paths = ""); // Fixes time on devices which need it (time_paths is a space separated list of paths to check for ats_* files)
 	static std::vector<std::string> Split_String(const std::string& str, const std::string& delimiter, bool removeEmpty = true); // Splits string by delimiter
 	static bool Create_Dir_Recursive(const std::string& path, mode_t mode = 0755, uid_t uid = -1, gid_t gid = -1);  // Create directory and it's parents, if they don't exist. mode, uid and gid are set to all _newly_ created folders. If whole path exists, do nothing.
 	static int Set_Brightness(std::string brightness_value); // Well, you can read, it does what it says, passing return int from TWFunc::Write_File ;)