aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMårten Kongstad <amhk@google.com>2024-05-06 16:26:40 +0200
committerMårten Kongstad <amhk@google.com>2024-05-07 13:16:13 +0200
commit04d8b46c37a2b68c41ea91614d810f84353da63b (patch)
tree86115ea0150fc3234f32354cf4354f3fff9d25af /tools
parent7c3571fe8b8601003165d608f7f7ceef34ad4fe0 (diff)
downloadbuild-04d8b46c37a2b68c41ea91614d810f84353da63b.tar.gz
check-flagged-apis: skip self-referential interfaces
The return value of ClassItem.allInterfaces will sometimes include the interface itself (e.g. android.accessibilityservice.BrailleDisplayController). It is unclear when this happens; it doesn't happen for the unit test. Update the logic to record the interfaces for a class to filter out interfaces named the same as the class. Bug: 334870672 Test: atest --host check-flagged-apis-test Test: croot && ./build/tools/check-flagged-apis/check-flagged-apis.sh Change-Id: I8d93c230dfedde30e8d43fefd560a47944085d3a
Diffstat (limited to 'tools')
-rw-r--r--tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt5
1 files changed, 4 insertions, 1 deletions
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 0f58aa54b9..0d2d24e19f 100644
--- a/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt
+++ b/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt
@@ -198,7 +198,10 @@ internal fun parseApiSignature(path: String, input: InputStream): Set<Pair<Symbo
val symbol =
Symbol.createClass(
cls.baselineElementId(),
- cls.allInterfaces().map { it.baselineElementId() }.toSet())
+ cls.allInterfaces()
+ .map { it.baselineElementId() }
+ .filter { it != cls.baselineElementId() }
+ .toSet())
output.add(Pair(symbol, flag))
}
}