Improve backup display names with emulated storage
-Change backup display name to say that we are excluding storage -Add warning message during backup of any partition with data media -Also eliminate unused variable from twrpTar class Maybe this will make the people in issue 276 happy, but probably not because they already lost their data, or because the warning text is yellow instead of red. https://github.com/TeamWin/Team-Win-Recovery-Project/issues/276 Change-Id: I98303fe7f6b7a25fea029637c90145258d41ee46
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
<string name="recovery">Recovery</string>
|
||||
<string name="cache">Cache</string>
|
||||
<string name="data">Data</string>
|
||||
<string name="data_backup">Data (excl. storage)</string>
|
||||
<string name="sdcard">SDCard</string>
|
||||
<string name="internal">Internal Storage</string>
|
||||
<string name="microsd">Micro SDCard</string>
|
||||
@@ -595,6 +596,7 @@
|
||||
<string name="remove_all">Removing all files under '{1}'</string>
|
||||
<string name="wiping_data">Wiping data without wiping /data/media ...</string>
|
||||
<string name="backing_up">Backing up {1}...</string>
|
||||
<string name="backup_storage_warning">Backups of {1} do not include any files in internal storage such as pictures or downloads.</string>
|
||||
<string name="backing">Backing Up</string>
|
||||
<string name="backup_size">Backup file size for '{1}' is 0 bytes.</string>
|
||||
<string name="datamedia_fs_restore">WARNING: This /data backup was made with {1} file system! The backup may not boot unless you change back to {1}.</string>
|
||||
|
||||
@@ -2210,7 +2210,8 @@ bool TWPartition::Backup_Tar(PartitionSettings *part_settings, pid_t *tar_fork_p
|
||||
|
||||
Backup_FileName = Backup_Name + "." + Current_File_System + ".win";
|
||||
Full_FileName = part_settings->Backup_Folder + "/" + Backup_FileName;
|
||||
tar.has_data_media = Has_Data_Media;
|
||||
if (Has_Data_Media)
|
||||
gui_msg(Msg(msg::kWarning, "backup_storage_warning=Backups of {1} do not include any files in internal storage such as pictures or downloads.")(Display_Name));
|
||||
tar.part_settings = part_settings;
|
||||
tar.backup_exclusions = &backup_exclusions;
|
||||
tar.setdir(Backup_Path);
|
||||
|
||||
@@ -2383,8 +2383,8 @@ void TWPartitionManager::Translate_Partition(const char* path, const char* resou
|
||||
TWPartition* part = PartitionManager.Find_Partition_By_Path(path);
|
||||
if (part) {
|
||||
if (part->Is_Adopted_Storage) {
|
||||
part->Backup_Display_Name = part->Display_Name + " - " + gui_lookup("data_backup", "Data (excl. storage)");
|
||||
part->Display_Name = part->Display_Name + " - " + gui_lookup("data", "Data");
|
||||
part->Backup_Display_Name = part->Display_Name;
|
||||
part->Storage_Name = part->Storage_Name + " - " + gui_lookup("adopted_storage", "Adopted Storage");
|
||||
} else {
|
||||
part->Display_Name = gui_lookup(resource_name, default_value);
|
||||
@@ -2395,6 +2395,22 @@ void TWPartitionManager::Translate_Partition(const char* path, const char* resou
|
||||
}
|
||||
}
|
||||
|
||||
void TWPartitionManager::Translate_Partition(const char* path, const char* resource_name, const char* default_value, const char* storage_resource_name, const char* storage_default_value, const char* backup_name, const char* backup_default) {
|
||||
TWPartition* part = PartitionManager.Find_Partition_By_Path(path);
|
||||
if (part) {
|
||||
if (part->Is_Adopted_Storage) {
|
||||
part->Backup_Display_Name = part->Display_Name + " - " + gui_lookup(backup_name, backup_default);
|
||||
part->Display_Name = part->Display_Name + " - " + gui_lookup("data", "Data");
|
||||
part->Storage_Name = part->Storage_Name + " - " + gui_lookup("adopted_storage", "Adopted Storage");
|
||||
} else {
|
||||
part->Display_Name = gui_lookup(resource_name, default_value);
|
||||
part->Backup_Display_Name = gui_lookup(backup_name, backup_default);
|
||||
if (part->Is_Storage)
|
||||
part->Storage_Name = gui_lookup(storage_resource_name, storage_default_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TWPartitionManager::Translate_Partition_Display_Names() {
|
||||
LOGINFO("Translating partition display names\n");
|
||||
Translate_Partition("/system", "system", "System");
|
||||
@@ -2402,17 +2418,19 @@ void TWPartitionManager::Translate_Partition_Display_Names() {
|
||||
Translate_Partition("/vendor", "vendor", "Vendor");
|
||||
Translate_Partition("/vendor_image", "vendor_image", "Vendor Image");
|
||||
Translate_Partition("/cache", "cache", "Cache");
|
||||
Translate_Partition("/data", "data", "Data", "internal", "Internal Storage");
|
||||
Translate_Partition("/boot", "boot", "Boot");
|
||||
Translate_Partition("/recovery", "recovery", "Recovery");
|
||||
if (!datamedia) {
|
||||
Translate_Partition("/data", "data", "Data", "internal", "Internal Storage");
|
||||
Translate_Partition("/sdcard", "sdcard", "SDCard", "sdcard", "SDCard");
|
||||
Translate_Partition("/internal_sd", "sdcard", "SDCard", "sdcard", "SDCard");
|
||||
Translate_Partition("/internal_sdcard", "sdcard", "SDCard", "sdcard", "SDCard");
|
||||
Translate_Partition("/emmc", "sdcard", "SDCard", "sdcard", "SDCard");
|
||||
} else {
|
||||
Translate_Partition("/data", "data", "Data", "internal", "Internal Storage", "data_backup", "Data (excl. storage)");
|
||||
}
|
||||
Translate_Partition("/external_sd", "microsd", "Micro SDCard", "microsd", "Micro SDCard");
|
||||
Translate_Partition("/external_sdcard", "microsd", "Micro SDCard", "microsd", "Micro SDCard");
|
||||
Translate_Partition("/external_sd", "microsd", "Micro SDCard", "microsd", "Micro SDCard", "data_backup", "Data (excl. storage)");
|
||||
Translate_Partition("/external_sdcard", "microsd", "Micro SDCard", "microsd", "Micro SDCard", "data_backup", "Data (excl. storage)");
|
||||
Translate_Partition("/usb-otg", "usbotg", "USB OTG", "usbotg", "USB OTG");
|
||||
Translate_Partition("/sd-ext", "sdext", "SD-EXT");
|
||||
|
||||
|
||||
@@ -285,6 +285,7 @@ public:
|
||||
bool Remove_MTP_Storage(unsigned int Storage_ID); // Adds or removes an MTP Storage partition
|
||||
void Translate_Partition(const char* path, const char* resource_name, const char* default_value);
|
||||
void Translate_Partition(const char* path, const char* resource_name, const char* default_value, const char* storage_resource_name, const char* storage_default_value);
|
||||
void Translate_Partition(const char* path, const char* resource_name, const char* default_value, const char* storage_resource_name, const char* storage_default_value, const char* backup_name, const char* backup_default);
|
||||
void Translate_Partition_Display_Names(); // Updates display names based on translations
|
||||
void Decrypt_Adopted(); // Attempt to identy and decrypt any adopted storage partitions
|
||||
void Remove_Partition_By_Path(string Path); // Removes / erases a partition entry from the partition list
|
||||
|
||||
@@ -67,7 +67,6 @@ twrpTar::twrpTar(void) {
|
||||
userdata_encryption = 0;
|
||||
use_compression = 0;
|
||||
split_archives = 0;
|
||||
has_data_media = 0;
|
||||
pigz_pid = 0;
|
||||
oaes_pid = 0;
|
||||
Total_Backup_Size = 0;
|
||||
|
||||
@@ -62,7 +62,6 @@ public:
|
||||
int userdata_encryption;
|
||||
int use_compression;
|
||||
int split_archives;
|
||||
int has_data_media;
|
||||
string backup_name;
|
||||
int progress_pipe_fd;
|
||||
string partition_name;
|
||||
|
||||
Reference in New Issue
Block a user