Add partition list GUI element

Add partition list GUI element and update backup, restore, mount,
storage selection, and wipe sections of GUI and partition manager
code to reflect the new GUI element. Update ORS engine to handle
new backup and restore setup.

Fix a bug with decrypt.
Add 1080x1920 layout.

Change-Id: Iaa2f44cb707167e66f935452f076ba00e68a2aa4
diff --git a/gui/action.cpp b/gui/action.cpp
index ca968d0..3456324 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1,4 +1,20 @@
-// image.cpp - GUIImage object
+/*
+	Copyright 2013 bigbiff/Dees_Troy TeamWin
+	This file is part of TWRP/TeamWin Recovery Project.
+
+	TWRP is free software: you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation, either version 3 of the License, or
+	(at your option) any later version.
+
+	TWRP is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with TWRP.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -745,6 +761,51 @@
 					ret_val = PartitionManager.Wipe_By_Path(External_Path);
 				} else if (arg == "ANDROIDSECURE") {
 					ret_val = PartitionManager.Wipe_Android_Secure();
+				} else if (arg == "LIST") {
+					string Wipe_List, wipe_path;
+					bool skip = false;
+					ret_val = true;
+					TWPartition* wipe_part = NULL;
+
+					DataManager::GetValue("tw_wipe_list", Wipe_List);
+					LOGI("wipe list '%s'\n", Wipe_List.c_str());
+					if (!Wipe_List.empty()) {
+						size_t start_pos = 0, end_pos = Wipe_List.find(";", start_pos);
+						while (end_pos != string::npos && start_pos < Wipe_List.size()) {
+							wipe_path = Wipe_List.substr(start_pos, end_pos - start_pos);
+							LOGI("wipe_path '%s'\n", wipe_path.c_str());
+							if (wipe_path == "/and-sec") {
+								if (!PartitionManager.Wipe_Android_Secure()) {
+									LOGE("Unable to wipe android secure\n");
+									ret_val = false;
+									break;
+								} else {
+									skip = true;
+								}
+							} else if (wipe_path == "DALVIK") {
+								if (!PartitionManager.Wipe_Dalvik_Cache()) {
+									LOGE("Failed to wipe dalvik\n");
+									ret_val = false;
+									break;
+								} else {
+									skip = true;
+								}
+							}
+							if (!skip) {
+								if (!PartitionManager.Wipe_By_Path(wipe_path)) {
+									LOGE("Unable to wipe '%s'\n", wipe_path.c_str());
+									ret_val = false;
+									break;
+								} else if (wipe_path == DataManager::GetSettingsStoragePath()) {
+									arg = wipe_path;
+								}
+							} else {
+								skip = false;
+							}
+							start_pos = end_pos + 1;
+							end_pos = Wipe_List.find(";", start_pos);
+						}
+					}
 				} else
 					ret_val = PartitionManager.Wipe_By_Path(arg);