Ensure that stubs.symbol_file has ".map.txt" suffix

The property refers to the symbol file that describes APIs across
updatable components like APEXes and system/vendor. Since it's important
to keep the APIs backwards incompatible, any change to the APIs should
be reviewed/gated by the NDK API council. The map.txt suffix is the key
for trigging the NDK API review by gerrit.

Bug: N/A
Test: m nothing
Change-Id: I01eae9c6a106d301863ec86e169111712af74d3f
diff --git a/cc/library.go b/cc/library.go
index 29a3c69..7df5d34 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -647,6 +647,11 @@
 		return objs
 	}
 	if library.buildStubs() {
+		symbolFile := String(library.Properties.Stubs.Symbol_file)
+		if symbolFile != "" && !strings.HasSuffix(symbolFile, ".map.txt") {
+			ctx.PropertyErrorf("symbol_file", "%q doesn't have .map.txt suffix", symbolFile)
+			return Objects{}
+		}
 		objs, versionScript := compileStubLibrary(ctx, flags, String(library.Properties.Stubs.Symbol_file), library.MutatedProperties.StubsVersion, "--apex")
 		library.versionScriptPath = android.OptionalPathForPath(versionScript)
 		return objs