Move LLNDK and NDK versionSelectorMutator special cases into versionedInterface

Implement stubsVersions on *llndkStubDecorator and *stubDecorator to
handle the special cases in versionSelectorMutator.

Test: m checkbuild
Change-Id: Idc985c52f91450df42c0275b2b2acef3f2ed8868
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index bb0f2e8..f2ad652 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -104,7 +104,7 @@
 	return stub.apiLevel.GreaterThanOrEqualTo(stub.unversionedUntil)
 }
 
-func ndkLibraryVersions(ctx android.BottomUpMutatorContext, from android.ApiLevel) []string {
+func ndkLibraryVersions(ctx android.BaseMutatorContext, from android.ApiLevel) []string {
 	var versions []android.ApiLevel
 	versionStrs := []string{}
 	for _, version := range ctx.Config().AllSupportedApiLevels() {
@@ -118,6 +118,19 @@
 	return versionStrs
 }
 
+func (this *stubDecorator) stubsVersions(ctx android.BaseMutatorContext) []string {
+	if !ctx.Module().Enabled() {
+		return nil
+	}
+	firstVersion, err := nativeApiLevelFromUser(ctx,
+		String(this.properties.First_version))
+	if err != nil {
+		ctx.PropertyErrorf("first_version", err.Error())
+		return nil
+	}
+	return ndkLibraryVersions(ctx, firstVersion)
+}
+
 func (this *stubDecorator) initializeProperties(ctx BaseModuleContext) bool {
 	this.apiLevel = nativeApiLevelOrPanic(ctx, this.stubsVersion())