Annotate more java dependencies for licensing

Annotate more dependencies as runtime linked or toolchain.

Bug: 207445310
Test: m checkbuild
Change-Id: Ia5dc3321a1e476b16058eee94d6dc494fe1e933e
diff --git a/android/license_metadata.go b/android/license_metadata.go
index 4c71a8c..544295c 100644
--- a/android/license_metadata.go
+++ b/android/license_metadata.go
@@ -224,6 +224,9 @@
 	// LicenseAnnotationSharedDependency should be returned by LicenseAnnotations implementations
 	// of dependency tags when the usage of the dependency is dynamic, for example a shared library
 	// linkage for native modules or as a classpath library for java modules.
+	//
+	// Dependency tags that need to always return LicenseAnnotationSharedDependency
+	// can embed LicenseAnnotationSharedDependencyTag to implement LicenseAnnotations.
 	LicenseAnnotationSharedDependency LicenseAnnotation = "dynamic"
 
 	// LicenseAnnotationToolchain should be returned by LicenseAnnotations implementations of
@@ -234,6 +237,14 @@
 	LicenseAnnotationToolchain LicenseAnnotation = "toolchain"
 )
 
+// LicenseAnnotationSharedDependencyTag can be embedded in a dependency tag to implement
+// LicenseAnnotations that always returns LicenseAnnotationSharedDependency.
+type LicenseAnnotationSharedDependencyTag struct{}
+
+func (LicenseAnnotationSharedDependencyTag) LicenseAnnotations() []LicenseAnnotation {
+	return []LicenseAnnotation{LicenseAnnotationSharedDependency}
+}
+
 // LicenseAnnotationToolchainDependencyTag can be embedded in a dependency tag to implement
 // LicenseAnnotations that always returns LicenseAnnotationToolchain.
 type LicenseAnnotationToolchainDependencyTag struct{}