Merge AOSP android-9.0.0_r3

Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
diff --git a/twrpAdbBuFifo.cpp b/twrpAdbBuFifo.cpp
index 1147d63..f98eb05 100644
--- a/twrpAdbBuFifo.cpp
+++ b/twrpAdbBuFifo.cpp
@@ -41,7 +41,6 @@
 
 void twrpAdbBuFifo::Check_Adb_Fifo_For_Events(void) {
 	char cmd[512];
-	int ret;
 
 	memset(&cmd, 0, sizeof(cmd));
 
@@ -169,10 +168,9 @@
 bool twrpAdbBuFifo::Restore_ADB_Backup(void) {
 	int partition_count = 0;
 	std::string Restore_Name;
-	std::size_t pos = 0;
 	struct AdbBackupFileTrailer adbmd5;
 	struct PartitionSettings part_settings;
-	int adb_control_twrp_fd, adb_write_fd, systemro;
+	int adb_control_twrp_fd;
 	int adb_control_bu_fd, ret = 0;
 	char cmd[512];