summaryrefslogtreecommitdiff
path: root/scripts/hiddenapi/verify_overlaps.py
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-07-20 18:03:53 +0100
committer Paul Duffin <paulduffin@google.com> 2021-08-11 17:29:47 +0100
commit280bae6d204aa5720a4f42d265afd6173f1201b1 (patch)
tree3a37520bc867c0180f278fc61ac00cf8178392ab /scripts/hiddenapi/verify_overlaps.py
parent726d44a86d91d5ada7ea3054f4ce37a35fb7e170 (diff)
Filter blocked entries from modular flag files
Previously, the sdk snapshot would include all the entries from the stub-flags.csv and all-flags.csv modular files generated by a single bootclasspath_fragment. That included implementation details, i.e. class members that are not part of a stable API or the hidden API which meant that the sdk snapshots were implementation dependent. This change removes the implementation details from the modular flag files, i.e. those entries that are only marked as "blocked". When comparing the files against the corresponding subset of the monolithic files it assumes that any entries missing from the modular flag files are blocked. Bug: 194063708 Test: atest --host verify_overlaps_test signature_patterns_test m out/soong/hiddenapi/hiddenapi-flags.csv - manually change files to cause difference in flags to check that it detects the differences. Change-Id: I6b67b2253cf029d6830b58a06ebb0c8fcaa0dd71
Diffstat (limited to 'scripts/hiddenapi/verify_overlaps.py')
-rwxr-xr-xscripts/hiddenapi/verify_overlaps.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/hiddenapi/verify_overlaps.py b/scripts/hiddenapi/verify_overlaps.py
index a4a423ed6..6432bf1a4 100755
--- a/scripts/hiddenapi/verify_overlaps.py
+++ b/scripts/hiddenapi/verify_overlaps.py
@@ -331,8 +331,11 @@ def compare_signature_flags(monolithicFlagsDict, modularFlagsDict):
for signature in allSignatures:
monolithicRow = monolithicFlagsDict.get(signature, {})
monolithicFlags = monolithicRow.get(None, [])
- modularRow = modularFlagsDict.get(signature, {})
- modularFlags = modularRow.get(None, [])
+ if signature in modularFlagsDict:
+ modularRow = modularFlagsDict.get(signature, {})
+ modularFlags = modularRow.get(None, [])
+ else:
+ modularFlags = ["blocked"]
if monolithicFlags != modularFlags:
mismatchingSignatures.append((signature, modularFlags, monolithicFlags))
return mismatchingSignatures