Capture list of unused methods when shrinking in R8

Use the -printusage flag in R8 to output a list of the unused
methods.  Some of the files can be large (2MB for DocumentsUI,
87MB for all of AOSP), so immediately zip them and remove the
originals.  The zipped files will be merged and disted.

Bug: 151857441
Test: m TARGET_BUILD_APPS=DocumentsUI dist
Change-Id: I780e84e80eba7fe4d4fa15fec0f461890afd900b
Merged-In: I780e84e80eba7fe4d4fa15fec0f461890afd900b
(cherry picked from commit cb6143a142a3a7985d18ad346a6c21314b90cf87)
diff --git a/android/override_module.go b/android/override_module.go
index 90ddf50..3d8b18b 100644
--- a/android/override_module.go
+++ b/android/override_module.go
@@ -302,3 +302,15 @@
 		}
 	}
 }
+
+// ModuleNameWithPossibleOverride returns the name of the OverrideModule that overrides the current
+// variant of this OverridableModule, or ctx.ModuleName() if this module is not an OverridableModule
+// or if this variant is not overridden.
+func ModuleNameWithPossibleOverride(ctx ModuleContext) string {
+	if overridable, ok := ctx.Module().(OverridableModule); ok {
+		if o := overridable.GetOverriddenBy(); o != "" {
+			return o
+		}
+	}
+	return ctx.ModuleName()
+}