commit | e8120390369affabf89569e560de2754ea016e2d | [log] [tgz] |
---|---|---|
author | Mårten Kongstad <amhk@google.com> | Mon May 06 21:32:34 2024 +0200 |
committer | Mårten Kongstad <amhk@google.com> | Tue May 07 13:28:54 2024 +0200 |
tree | 715633f7678a587278fffb0d8484720db393b7a4 | |
parent | c3f05a6d92a31d800373217264fd88f55c070739 [diff] [blame] |
check-flagged-apis: consider superclasses when looking up symbol If a symbol can't be found in a class, (recursively) check the class' superclass before reporting the symbol as missing. Bug: 334870672 Test: atest --host check-flagged-apis-test Change-Id: I8ef1fbfcc51e0c5ba00959536c087213d688fe39
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 dc0d31c..b514048 100644 --- a/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt +++ b/tools/check-flagged-apis/src/com/android/checkflaggedapis/Main.kt
@@ -378,6 +378,11 @@ } } + if (clazz.superclass != null) { + val superclassSymbol = Symbol.createMethod(clazz.superclass, memberName) + return containsSymbol(superclassSymbol) + } + return false } val errors = mutableSetOf<ApiError>()