Support adding a library as both a JNI library and a regular library.

Bug: 299087066
Test: m nothing
Change-Id: I6cafe23395b7306727a071ccefe3b189c56e928b
diff --git a/apex/apex.go b/apex/apex.go
index 52a5e20..1e65b0f 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2008,6 +2008,9 @@
 			// If a module is directly included and also transitively depended on
 			// consider it as directly included.
 			e.transitiveDep = e.transitiveDep && f.transitiveDep
+			// If a module is added as both a JNI library and a regular shared library, consider it as a
+			// JNI library.
+			e.isJniLib = e.isJniLib || f.isJniLib
 			encountered[dest] = e
 		}
 	}