Merge "Introduce boot_image_type property in bootimg module" into main
diff --git a/apex/apex.go b/apex/apex.go
index 91d01b0..dd9195c 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2083,7 +2083,7 @@
 				//
 				// Skip the dependency in unbundled builds where the device image is not
 				// being built.
-				if ch.IsStubsImplementationRequired() && !am.DirectlyInAnyApex() && !ctx.Config().UnbundledBuild() {
+				if ch.IsStubsImplementationRequired() && !am.NotInPlatform() && !ctx.Config().UnbundledBuild() {
 					// we need a module name for Make
 					name := ch.ImplementationModuleNameForMake(ctx) + ch.Properties.SubName
 					if !android.InList(name, a.makeModulesToInstall) {