diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/aapt2/link/ManifestFixer.cpp | 1 | ||||
| -rwxr-xr-x | tools/fonts/fontchain_linter.py | 56 | ||||
| -rw-r--r-- | tools/validatekeymaps/Android.bp | 4 | ||||
| -rw-r--r-- | tools/validatekeymaps/Main.cpp | 5 | ||||
| -rw-r--r-- | tools/xmlpersistence/src/main/kotlin/Generator.kt | 1 |
5 files changed, 15 insertions, 52 deletions
diff --git a/tools/aapt2/link/ManifestFixer.cpp b/tools/aapt2/link/ManifestFixer.cpp index d432341a8cde..948b11b6795e 100644 --- a/tools/aapt2/link/ManifestFixer.cpp +++ b/tools/aapt2/link/ManifestFixer.cpp @@ -477,6 +477,7 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor, manifest_action["compatible-screens"]["screen"]; manifest_action["supports-gl-texture"]; manifest_action["restrict-update"]; + manifest_action["install-constraints"]["fingerprint-prefix"]; manifest_action["package-verifier"]; manifest_action["meta-data"] = meta_data_action; manifest_action["uses-split"].Action(RequiredNameIsJavaPackage); diff --git a/tools/fonts/fontchain_linter.py b/tools/fonts/fontchain_linter.py index 35a0ce60e359..50fce57add39 100755 --- a/tools/fonts/fontchain_linter.py +++ b/tools/fonts/fontchain_linter.py @@ -381,62 +381,14 @@ def hex_strs(sequence): return tuple(f"{s:X}" for s in sequence) return hex(sequence) -def check_plausible_compat_pua(coverage, all_emoji, equivalent_emoji): - # A PUA should point to every RGI emoji and that PUA should be unique to the - # set of equivalent sequences for the emoji. - problems = [] - for seq in all_emoji: - # We're looking to match not-PUA with PUA so filter out existing PUA - if contains_pua(seq): - continue - - # Filter out non-RGI things that end up in all_emoji - if only_tags(seq) or seq in {ZWJ, COMBINING_KEYCAP, EMPTY_FLAG_SEQUENCE}: - continue - - equivalents = [seq] - if seq in equivalent_emoji: - equivalents.append(equivalent_emoji[seq]) - - # If there are problems the hex code is much more useful - log_equivalents = [hex_strs(s) for s in equivalents] - - # The system compat font should NOT include regional indicators as these have been split out - if contains_regional_indicator(seq): - assert not any(s in coverage for s in equivalents), f"Regional indicators not expected in compat font, found {log_equivalents}" - continue - - glyph = {coverage[e] for e in equivalents} - if len(glyph) != 1: - problems.append(f"{log_equivalents} should all point to the same glyph") - continue - glyph = next(iter(glyph)) - - pua = {s for s, g in coverage.items() if contains_pua(s) and g == glyph} - if not pua: - problems.append(f"Expected PUA for {log_equivalents} but none exist") - continue - - assert not problems, "\n".join(sorted(problems)) + f"\n{len(problems)} PUA problems" - -def check_emoji_compat(all_emoji, equivalent_emoji): +def check_emoji_not_compat(all_emoji, equivalent_emoji): compat_psnames = set() for emoji_font in get_emoji_fonts(): ttf = open_font(emoji_font) psname = get_psname(ttf) - is_compat_font = "meta" in ttf and 'Emji' in ttf["meta"].data - if not is_compat_font: - continue - compat_psnames.add(psname) - - # If the font has compat metadata it should have PUAs for emoji sequences - coverage = get_emoji_map(emoji_font) - check_plausible_compat_pua(coverage, all_emoji, equivalent_emoji) - - - # NotoColorEmoji must be a Compat font. - assert 'NotoColorEmoji' in compat_psnames, 'NotoColorEmoji MUST be a compat font' + if "meta" in ttf: + assert 'Emji' not in ttf["meta"].data, 'NotoColorEmoji MUST NOT be a compat font' def check_emoji_font_coverage(emoji_fonts, all_emoji, equivalent_emoji): @@ -847,7 +799,7 @@ def main(): ucd_path = sys.argv[3] parse_ucd(ucd_path) all_emoji, default_emoji, equivalent_emoji = compute_expected_emoji() - check_emoji_compat(all_emoji, equivalent_emoji) + check_emoji_not_compat(all_emoji, equivalent_emoji) check_emoji_coverage(all_emoji, equivalent_emoji) check_emoji_defaults(default_emoji) diff --git a/tools/validatekeymaps/Android.bp b/tools/validatekeymaps/Android.bp index ff24d160b917..25373f9e9e2f 100644 --- a/tools/validatekeymaps/Android.bp +++ b/tools/validatekeymaps/Android.bp @@ -21,6 +21,7 @@ cc_binary_host { cflags: [ "-Wall", "-Werror", + "-Wextra", ], static_libs: [ @@ -31,6 +32,9 @@ cc_binary_host { "liblog", "libui-types", ], + shared_libs: [ + "libvintf", + ], target: { host_linux: { static_libs: [ diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp index 817effd24a2d..0d7d5f949a08 100644 --- a/tools/validatekeymaps/Main.cpp +++ b/tools/validatekeymaps/Main.cpp @@ -141,6 +141,11 @@ static bool validateFile(const char* filename) { } base::Result<std::shared_ptr<KeyLayoutMap>> ret = KeyLayoutMap::load(filename); if (!ret.ok()) { + if (ret.error().message() == "Missing kernel config") { + // It means the layout is valid, but won't be loaded on this device because + // this layout requires a certain kernel config. + return true; + } error("Error %s parsing key layout file.\n\n", ret.error().message().c_str()); return false; } diff --git a/tools/xmlpersistence/src/main/kotlin/Generator.kt b/tools/xmlpersistence/src/main/kotlin/Generator.kt index b2c5f4ac767b..8e62388c860f 100644 --- a/tools/xmlpersistence/src/main/kotlin/Generator.kt +++ b/tools/xmlpersistence/src/main/kotlin/Generator.kt @@ -149,6 +149,7 @@ private val ClassFieldInfo.allClassFields: List<ClassFieldInfo> when (field) { is ClassFieldInfo -> this += field.allClassFields is ListFieldInfo -> this += field.element.allClassFields + else -> {} } } } |