Enable Android Lint tests for AndroidFrameworkLintChecker

Create AndroidFrameworkLintCheckerTest module and add
.allowMissingSdk(true) to all tests to enable tests running on gerrit.

"unit_test: true" marks the module as a unit test target which runs it
on the host without a device and it automatically gets onboarded in the
presubmit.

Bug: 157626959
Test: atest AndroidFrameworkLintCheckerTest --host
Change-Id: I66c6e331e72dfca45d341a49eb43fbd73ccd28ff
diff --git a/tools/lint/Android.bp b/tools/lint/Android.bp
index dcbc32b..17547ef 100644
--- a/tools/lint/Android.bp
+++ b/tools/lint/Android.bp
@@ -31,16 +31,16 @@
     ],
 }
 
-// TODO: (b/162368644) Implement these (working in gradle) Kotlin Tests to run on Soong
-//java_test_host {
-//    name: "AndroidFrameworkLintCheckerTest",
-//    srcs: [
-//     "checks/src/test/java/**/*.kt",
-//     "checks/src/main/java/**/*.kt",
-//    ],
-//    plugins: ["auto_service_plugin"],
-//    static_libs: [
-//        "auto_service_annotations",
-//        "lint_api",
-//    ],
-//}
+java_test_host {
+    name: "AndroidFrameworkLintCheckerTest",
+    srcs: ["checks/src/test/java/**/*.kt"],
+    static_libs: [
+        "AndroidFrameworkLintChecker",
+        "junit",
+        "lint",
+        "lint_tests",
+    ],
+    test_options: {
+        unit_test: true,
+    },
+}
diff --git a/tools/lint/checks/src/test/java/com/google/android/lint/CallingIdentityTokenDetectorTest.kt b/tools/lint/checks/src/test/java/com/google/android/lint/CallingIdentityTokenDetectorTest.kt
index 0532c20..8f67555 100644
--- a/tools/lint/checks/src/test/java/com/google/android/lint/CallingIdentityTokenDetectorTest.kt
+++ b/tools/lint/checks/src/test/java/com/google/android/lint/CallingIdentityTokenDetectorTest.kt
@@ -18,6 +18,7 @@
 
 import com.android.tools.lint.checks.infrastructure.LintDetectorTest
 import com.android.tools.lint.checks.infrastructure.TestFile
+import com.android.tools.lint.checks.infrastructure.TestLintTask
 import com.android.tools.lint.detector.api.Detector
 import com.android.tools.lint.detector.api.Issue
 
@@ -34,6 +35,8 @@
             CallingIdentityTokenDetector.ISSUE_CLEAR_IDENTITY_CALL_NOT_FOLLOWED_BY_TRY_FINALLY
     )
 
+    override fun lint(): TestLintTask = super.lint().allowMissingSdk(true)
+
     /** No issue scenario */
 
     fun testDoesNotDetectIssuesInCorrectScenario() {