Ignore license and similar dependencies of prebuilt_apex/apex_set

Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.

This change simply ignores any module that does not implement
ApexModule.

Bug: 179354495
Test: m nothing
Merged-In: Iead6f9d1085d169335b88ceadcce2d8cc042254d
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
(cherry picked from commit fee8cf36e3f5c3280b470c8829c9f9a9d4594337)
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index f783172..1bb0fb5 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -376,6 +376,12 @@
 			}
 		}
 
+		// Ignore any modules that do not implement ApexModule as they cannot have an APEX specific
+		// variant.
+		if _, ok := child.(android.ApexModule); !ok {
+			return false
+		}
+
 		// Strip off the prebuilt_ prefix if present before storing content to ensure consistent
 		// behavior whether there is a corresponding source module present or not.
 		depName = android.RemoveOptionalPrebuiltPrefix(depName)