Fix missing headers of vendor snapshot

Changing of installable function has broken vendor snapshot's header
libraries. Fixing it and adding tests to prevent further breakage.

Bug: 157106227
Test: m vendor-snapshot captures header libraries
Change-Id: I8b581c1b2186ca2db85ae408e959c20bbd034db6
diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go
index 5801fc7..1ff617f 100644
--- a/cc/vendor_snapshot.go
+++ b/cc/vendor_snapshot.go
@@ -443,7 +443,7 @@
 		return false
 	}
 	// the module must be installed in /vendor
-	if !m.installable() || m.isSnapshotPrebuilt() || !m.inVendor() {
+	if !m.IsForPlatform() || m.isSnapshotPrebuilt() || !m.inVendor() {
 		return false
 	}
 	// exclude test modules
@@ -457,12 +457,17 @@
 
 	// Libraries
 	if l, ok := m.linker.(snapshotLibraryInterface); ok {
+		// header libraries are not installable, but captured.
+		if (l.static() || l.shared()) && !m.installable() {
+			return false
+		}
 		if l.static() {
 			return proptools.BoolDefault(m.VendorProperties.Vendor_available, true)
 		}
 		if l.shared() {
 			return !m.IsVndk()
 		}
+
 		return true
 	}