Allow skipping android.car-module library in PRODUCT_APEX_BOOT_JARS

- The library is added to bootclass path only for car product
  through com.android.car.framework apex module
- Ignore it even if it is not in PRODUCT_APEX_BOOT_JARS for
  non-car builds

Bug: 202345178
Bug: 202896428
Test: test boot up for non-car build
Change-Id: I4ba86b4c7f4d4005add9bb5c415aed39f119af0c
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 8f18790..4c8a779 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -619,6 +619,10 @@
 	} else if global.ApexBootJars.Len() != 0 && !android.IsModuleInVersionedSdk(ctx.Module()) {
 		unknown = android.RemoveListFromList(unknown, b.properties.Coverage.Contents)
 		_, unknown = android.RemoveFromList("core-icu4j", unknown)
+		// This module only exists in car products.
+		// So ignore it even if it is not in PRODUCT_APEX_BOOT_JARS.
+		// TODO(b/202896428): Add better way to handle this.
+		_, unknown = android.RemoveFromList("android.car-module", unknown)
 		if len(unknown) > 0 {
 			ctx.ModuleErrorf("%s in contents must also be declared in PRODUCT_APEX_BOOT_JARS", unknown)
 		}