Set data/recovery for Settings: complementary code
After https://gerrit.twrp.me/c/android_bootable_recovery/+/5670 some functions were not working properly, such as change TWRP folder and custom themes.
Signed-off-by: Fernando Oliveira <fernandoaju78@gmail.com>
Change-Id: Ifaa777e528a6ca68e628d1719ba6d232851d338d
(cherry picked from commit 25062d7904430cdb83e4b4eaf6db38715da88e49)
diff --git a/gui/action.cpp b/gui/action.cpp
index bbc71cb..ad41ece 100755
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -34,6 +34,7 @@
#include <dirent.h>
#include <private/android_filesystem_config.h>
#include <android-base/properties.h>
+#include <fstream>
#include <string>
#include <sstream>
@@ -2345,6 +2346,10 @@
if (ret) {
DataManager::SetValue(TW_RECOVERY_FOLDER_VAR, '/' + arg);
DataManager::SetValue(TW_BACKUPS_FOLDER_VAR, newBackupFolder);
+ //Creates an empty file that marks which folder is TWRP with the renamed new name, after reboot.
+ string path= newFolder + "/.twrpcf";
+ std::ofstream twrpcf(path);
+ twrpcf.close();
}
operation_end((int)!ret);
return 0;