Type pkgs w/ unsupported types in Java now work

Previously, if a package (typically a types-only package) declares types
which are not supported in Java, the type can't be compiled in Java.
However, this unnecessarily restricts some otherwise useful HALs from
being used in Java.

Note that all interfaces in a package must be Java compatible in order
for the package to be compiled in Java (this doesn't support compiling a
subset of the interfaces in Java). This is because in HIDL, the build
system must know exactly which files are outputed, and interfaces always
come with their own files. It would be much more work to handle this
other case, and there isn't a usecase for it now.

Note also that isJavaCompatible interfaces will always compile after
this CL since in order to be compiled in Java, they must only reference
java compatible types. This logic shouldn't rely on assumptions made at
the scope level, so it's safe to remove the scope logic (and if there is
a bug, the worst that will happen is a failed javac compile, which while
potentially confusing, the underlying cause can be fixed in hidl-gen).

Bug: 143566068
Test: cd $ANDROID_BUILD_TOP/hardware/interfaces && update-makefiles.sh
   && mma

Change-Id: I4c81ec269a766be9b1e1ef1fbbb3b1e55bcbce46
diff --git a/AST.h b/AST.h
index e9c1367..9026ebb 100644
--- a/AST.h
+++ b/AST.h
@@ -74,15 +74,16 @@
 
     // Look up local identifier.
     // It could be plain identifier or enum value as described by lookupEnumValue.
-    LocalIdentifier* lookupLocalIdentifier(const Reference<LocalIdentifier>& ref, Scope* scope);
+    LocalIdentifier* lookupLocalIdentifier(const Reference<LocalIdentifier>& ref,
+                                           const Scope* scope);
 
     // Look up an enum value by "FQName:valueName".
-    EnumValue* lookupEnumValue(const FQName& fqName, std::string* errorMsg, Scope* scope);
+    EnumValue* lookupEnumValue(const FQName& fqName, std::string* errorMsg, const Scope* scope);
 
     // Look up a type by FQName, "pure" names, i.e. those without package
     // or version are first looked up in the current scope chain.
     // After that lookup proceeds to imports.
-    Type* lookupType(const FQName& fqName, Scope* scope);
+    Type* lookupType(const FQName& fqName, const Scope* scope);
 
     void addImportedAST(AST *ast);
 
@@ -282,7 +283,7 @@
     bool importFQName(const FQName& fqName);
 
     // Helper functions for lookupType.
-    Type* lookupTypeLocally(const FQName& fqName, Scope* scope);
+    Type* lookupTypeLocally(const FQName& fqName, const Scope* scope);
     status_t lookupAutofilledType(const FQName &fqName, Type **returnedType);
     Type *lookupTypeFromImports(const FQName &fqName);