Add "import types" lint

Adding `import types;` to a hal file is redundant since types is always
imported.
Importing the types file from another package is bad since it imports
every single type from that file. Should prefer specific imports
instead.

Added a import statements vector to the AST so that it can track exactly
what is being imported. Using getImportedNames had some trouble as it
did not accurately represent the import statements.

Bug: 132905850
Test: ./test/run_all_host_tests.sh (hidl-lint_test
HidlLintTest.ImportTypesTest)
Change-Id: I91d354ab736f7134c4f0bb1822dc053dd0275556
diff --git a/AST.cpp b/AST.cpp
index 07f50be..68554a0 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -369,7 +369,7 @@
                                     &visited);
 }
 
-bool AST::addImport(const char *import) {
+bool AST::addImport(const char* import, const Location& location) {
     FQName fqName;
     if (!FQName::parse(import, &fqName)) {
         std::cerr << "ERROR: '" << import << "' is an invalid fully-qualified name." << std::endl;
@@ -378,6 +378,8 @@
 
     fqName.applyDefaults(mPackage.package(), mPackage.version());
 
+    mImportStatements.push_back({fqName, location});
+
     if (fqName.name().empty()) {
         // import a package
 
@@ -757,6 +759,10 @@
     return nullptr;
 }
 
+const std::vector<ImportStatement>& AST::getImportStatements() const {
+    return mImportStatements;
+}
+
 void AST::getImportedPackages(std::set<FQName> *importSet) const {
     for (const auto& fqName : mImportedNamesGranular) {
         FQName packageName = fqName.getPackageAndVersion();