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 --- partition.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'partition.cpp') diff --git a/partition.cpp b/partition.cpp index 3957c6542..59bd16831 100644 --- a/partition.cpp +++ b/partition.cpp @@ -581,6 +581,18 @@ bool TWPartition::Process_Fstab_Line(const char *fstab_line, bool Display_Error, 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; } -- cgit v1.2.3