Revert "Move MutateApexTransition shortcut later"

Revert submission 3477737-move_apex_shortcut

Reason for revert: Likely culprit for b/394990888 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3477737-move_apex_shortcut

Change-Id: I67459460e847451d06e733a01249e3dd8017a2e0
diff --git a/android/apex.go b/android/apex.go
index a5ccd52..c2f73a9 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -616,26 +616,25 @@
 		apexInfos = allApexInfos.ApexInfos
 	}
 
-	if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() {
-		// Do not install the module for platform, but still allow it to output
-		// uninstallable AndroidMk entries in certain cases when they have side
-		// effects.  TODO(jiyong): move this routine to somewhere else
-		module.MakeUninstallable()
+	// Shortcut
+	if len(apexInfos) == 0 {
+		return
 	}
 
 	// Do some validity checks.
 	// TODO(jiyong): is this the right place?
 	base.checkApexAvailableProperty(ctx)
 
-	// Shortcut
-	if len(apexInfos) == 0 {
-		return
-	}
-
 	if !module.UniqueApexVariations() && !base.ApexProperties.UniqueApexVariationsForDeps {
 		apexInfos, _ = mergeApexVariations(apexInfos)
 	}
 
+	if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() {
+		// Do not install the module for platform, but still allow it to output
+		// uninstallable AndroidMk entries in certain cases when they have side
+		// effects.  TODO(jiyong): move this routine to somewhere else
+		module.MakeUninstallable()
+	}
 	if !platformVariation {
 		var thisApexInfo ApexInfo