Reduce default visibility in external/dagger2

Expose only the modules expected to be used outside external/dagger2.

Test: m checkbuild
Change-Id: Idc1389c9b7906db19e09152f8686d10db5942dc2
diff --git a/Android.bp b/Android.bp
index 8836d5f..6612f8c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12,6 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+package {
+    default_visibility: [":__subpackages__"]
+}
+
 java_import_host {
     name: "dagger2-bootstrap-compiler-jar",
     jars: ["java/dagger/internal/codegen/bootstrap/bootstrap_compiler_deploy.jar"],
@@ -27,6 +31,7 @@
 
 java_library {
     name: "dagger2",
+    visibility: ["//visibility:public"],
     host_supported: true,
 
     srcs: [
@@ -75,6 +80,7 @@
 
 java_plugin {
     name: "dagger2-compiler",
+    visibility: ["//visibility:public"],
     processor_class: "dagger.internal.codegen.ComponentProcessor",
     generates_api: true,
     use_tools_jar: true,