Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04d8b46c authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

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
parent 7c3571fe
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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))
          }
        }