Modify non updatable droidstubs dependency based on release flag

Currently, the api file generated by the non updatable droidstubs are
copied to the dist directory regardless of the value of the
RELEASE_HIDDEN_API_EXPORTABLE_STUBS release flag. However, to align with
the other artifacts in the dist directory that respects the value of the
flag, the artifact of the everything stubs should be copied to the dist
directory when the flag value is not true, instead of the artifact of
the exportable stubs.

Test: m sdk dist && inspect the ninja dependency of out/dist/apistubs/android/test/api/android.txt
Bug: 329683584
Change-Id: I58b69893cf5e006691bf98465514f2320a5f7f55
diff --git a/api/Android.bp b/api/Android.bp
index 76cdf21..65baf78 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -378,6 +378,18 @@
     ],
 }
 
+soong_config_module_type {
+    name: "non_updatable_exportable_droidstubs",
+    module_type: "droidstubs",
+    config_namespace: "ANDROID",
+    bool_variables: [
+        "release_hidden_api_exportable_stubs",
+    ],
+    properties: [
+        "dists",
+    ],
+}
+
 // We resolve dependencies on APIs in modules by depending on a prebuilt of the whole
 // platform (sdk_system_current_android). That prebuilt does not include module-lib APIs,
 // so use the prebuilt module-lib stubs for modules that export module-lib stubs that the