summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2014-01-25 21:02:57 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-02-03 19:00:58 +0100
commitc7360dd26343b704350b7bc0911221c56ecf4695 (patch)
treea9cec440c2076e1898d50d96043949af18dfa9ed
parentAdd option to set flag for storage=0 (diff)
downloadandroid_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar.gz
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar.bz2
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar.lz
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar.xz
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.tar.zst
android_bootable_recovery-c7360dd26343b704350b7bc0911221c56ecf4695.zip
Diffstat (limited to '')
-rw-r--r--partition.cpp6
-rw-r--r--twrpDU.cpp11
-rw-r--r--twrpDU.hpp3
3 files changed, 16 insertions, 4 deletions
diff --git a/partition.cpp b/partition.cpp
index 13f0db71a..aeef04ea4 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -399,7 +399,6 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) {
} else if (Mount_Point == "/recovery") {
Display_Name = "Recovery";
Backup_Display_Name = Display_Name;
- Can_Be_Backed_Up = true;
}
}
@@ -1539,8 +1538,9 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media() {
// The media folder is the "internal sdcard"
// The .layout_version file is responsible for determining whether 4.2 decides up upgrade
// the media folder for multi-user.
+ //TODO: convert this to use twrpDU.cpp
if (strcmp(de->d_name, "media") == 0 || strcmp(de->d_name, ".layout_version") == 0) continue;
-
+
dir = "/data/";
dir.append(de->d_name);
if (de->d_type == DT_DIR) {
@@ -1551,6 +1551,7 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media() {
}
}
closedir(d);
+
gui_print("Done.\n");
return true;
}
@@ -1798,6 +1799,7 @@ bool TWPartition::Update_Size(bool Display_Error) {
unsigned long long data_media_used, actual_data;
du.add_relative_dir("media");
Used = du.Get_Folder_Size("/data");
+ du.clear_relative_dir("media");
Backup_Size = Used;
int bak = (int)(Used / 1048576LLU);
int fre = (int)(Free / 1048576LLU);
diff --git a/twrpDU.cpp b/twrpDU.cpp
index 66c803104..c4446d42a 100644
--- a/twrpDU.cpp
+++ b/twrpDU.cpp
@@ -43,6 +43,16 @@ void twrpDU::add_relative_dir(string dir) {
relativedir.push_back(dir);
}
+void twrpDU::clear_relative_dir(string dir) {
+ vector<string>::iterator iter = relativedir.begin();
+ while (iter != relativedir.end()) {
+ if (*iter == dir)
+ iter = relativedir.erase(iter);
+ else
+ iter++;
+ }
+}
+
void twrpDU::add_absolute_dir(string dir) {
absolutedir.push_back(dir);
}
@@ -97,7 +107,6 @@ bool twrpDU::check_skip_dirs(string& dir) {
}
}
for (int i = 0; i < absolutedir.size(); ++i) {
- //string absdir = parent + dir;
if (dir == absolutedir.at(i)) {
result = true;
break;
diff --git a/twrpDU.hpp b/twrpDU.hpp
index 04527cd61..dac15f126 100644
--- a/twrpDU.hpp
+++ b/twrpDU.hpp
@@ -40,8 +40,9 @@ public:
uint64_t Get_Folder_Size(const string& Path); // Gets the folder's size using stat
void add_absolute_dir(string Path);
void add_relative_dir(string Path);
- bool check_skip_dirs(string& dir); // Checks a list of directories to see if we should skip it
+ bool check_skip_dirs(string& dir);
vector<string> get_absolute_dirs(void);
+ void clear_relative_dir(string dir);
private:
vector<string> absolutedir;
vector<string> relativedir;