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/twinstall.cpp b/twinstall.cpp
index d63088c..a2f54c9 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -193,7 +193,7 @@
 
 	void *data = mmap(NULL, finfo.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
 	if (data == MAP_FAILED) {
-		LOGINFO("has_legacy_properties: mmap (size=%lld) failed: %s!\n", finfo.st_size, strerror(errno));
+		LOGINFO("has_legacy_properties: mmap (size=%zu) failed: %s!\n", finfo.st_size, strerror(errno));
 	} else {
 		if (memmem(data, finfo.st_size, str_to_match, len_to_match)) {
 			LOGINFO("has_legacy_properties: Found legacy property match!\n");