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/partition.cpp b/partition.cpp
index 3957c65..59bd168 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -581,6 +581,18 @@
 			Process_TW_Flags(flagptr, Display_Error, 1); // Forcing the fstab to ver 1 because this data is coming from the /etc/twrp.flags which should be using the TWRP v1 flags format
 		}
 	}
+
+	if (Mount_Point == "/persist" && Can_Be_Mounted) {
+		bool mounted = Is_Mounted();
+		if (mounted || Mount(false)) {
+			// Read the backup settings file
+			DataManager::LoadPersistValues();
+			TWFunc::Fixup_Time_On_Boot("/persist/time/");
+			if (!mounted)
+				UnMount(false);
+		}
+	}
+
 	return true;
 }