summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2017-02-03 22:30:52 +0100
committerEthan Yonker <dees_troy@teamw.in>2017-02-08 04:30:01 +0100
commit01f4e035aa0833252b99dcbda0e08a327ba8bf3d (patch)
tree1777db38008da21e982f76a9add17f92275b5a3c
parentMerge "Fix crash during check for TWRP app" into android-7.1 (diff)
downloadandroid_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar.gz
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar.bz2
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar.lz
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar.xz
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.tar.zst
android_bootable_recovery-01f4e035aa0833252b99dcbda0e08a327ba8bf3d.zip
Diffstat (limited to '')
-rw-r--r--gui/theme/common/languages/en.xml2
-rw-r--r--partition.cpp3
-rw-r--r--partitionmanager.cpp26
-rw-r--r--partitions.hpp1
-rw-r--r--twrpTar.cpp1
-rw-r--r--twrpTar.hpp1
6 files changed, 27 insertions, 7 deletions
diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml
index d91131293..72ef5affd 100644
--- a/gui/theme/common/languages/en.xml
+++ b/gui/theme/common/languages/en.xml
@@ -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>
diff --git a/partition.cpp b/partition.cpp
index 464438811..5cf017987 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -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);
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index f94b6aa22..9afc67727 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -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");
diff --git a/partitions.hpp b/partitions.hpp
index 450e8815b..0f0e6fd30 100644
--- a/partitions.hpp
+++ b/partitions.hpp
@@ -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
diff --git a/twrpTar.cpp b/twrpTar.cpp
index 7e4d29a7a..fa836fd51 100644
--- a/twrpTar.cpp
+++ b/twrpTar.cpp
@@ -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;
diff --git a/twrpTar.hpp b/twrpTar.hpp
index 92674ee61..b07b06f49 100644
--- a/twrpTar.hpp
+++ b/twrpTar.hpp
@@ -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;