diff --git a/tools/check-flagged-apis/src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt b/tools/check-flagged-apis/src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt index 111ea91f85..8e285f6216 100644 --- a/tools/check-flagged-apis/src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt +++ b/tools/check-flagged-apis/src/com/android/checkflaggedapis/CheckFlaggedApisTest.kt @@ -120,6 +120,26 @@ class CheckFlaggedApisTest { assertEquals(expected, actual) } + @Test + fun testParseApiSignatureInterfacesInheritFromJavaLangObject() { + val apiSignature = + """ + // Signature format: 2.0 + package android { + @FlaggedApi("android.flag.foo") public interface Interface { + } + } + """ + .trim() + val expected = + setOf( + Pair( + Symbol.createClass("android/Interface", "java/lang/Object", setOf()), + Flag("android.flag.foo"))) + val actual = parseApiSignature("in-memory", apiSignature.byteInputStream()) + assertEquals(expected, actual) + } + @Test fun testParseFlagValues() { val expected: Map = diff --git a/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt b/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt index a277ce815f..1d2440dee8 100644 --- a/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt +++ b/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt @@ -205,7 +205,11 @@ internal fun parseApiSignature(path: String, input: InputStream): Set