Validate upfront that an interface is compatible with our Java backend,

emit diagnostics if it is not. Also cleans up all other error messages to
clearly indicate an error condition.

Bug: 30876839
Change-Id: I18bcd723107ab93abcad38c976f3c38dda60a743
diff --git a/Interface.cpp b/Interface.cpp
index 42186af..d453986 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -122,5 +122,19 @@
     return OK;
 }
 
+bool Interface::isJavaCompatible() const {
+    if (!Scope::isJavaCompatible()) {
+        return false;
+    }
+
+    for (const auto &method : mMethods) {
+        if (!method->isJavaCompatible()) {
+            return false;
+        }
+    }
+
+    return true;
+}
+
 }  // namespace android