From e85f02dd9186079cf67a4d3e7d1657d248e28963 Mon Sep 17 00:00:00 2001 From: xNUTx Date: Fri, 18 Jul 2014 01:30:58 +0200 Subject: Support reading since_epoch and secondary brightness files TWFunc::Fixup_Time_On_Boot: Will now try to read /sys/class/rtc/rtc0/since_epoch to correct time, if that fails it will try to use the ats files to correct time. TWFunc::Set_Brightness: One single function to set brightness from both the automated functions and the gui actions. It is able to set a second brightness path if present, it will set them both the same value. Many Sony devices have 2 brightness files in the sysfs that must be set to properly set the brightness. Change-Id: I7ca582109085dfbcb46b8de73ad031e4b7903fca --- twrp-functions.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'twrp-functions.hpp') diff --git a/twrp-functions.hpp b/twrp-functions.hpp index a0c715195..5f46d4ff4 100644 --- a/twrp-functions.hpp +++ b/twrp-functions.hpp @@ -70,6 +70,7 @@ public: static int32_t timespec_diff_ms(timespec& start, timespec& end); // Returns diff in ms static int read_file(string fn, vector& results); //read from file static int read_file(string fn, string& results); //read from file + static int read_file(string fn, uint64_t& results); //read from file static int write_file(string fn, string& line); //write from file static int drop_caches(void); //drop linux cache memory static int Check_su_Perms(void); // check perms and owner of su binary in various locations @@ -83,6 +84,7 @@ public: static void Fixup_Time_On_Boot(); // Fixes time on devices which need it static std::vector 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 ;) private: static void Copy_Log(string Source, string Destination); -- cgit v1.2.3