diff options
Diffstat (limited to 'tools')
34 files changed, 278 insertions, 400 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index fecc7b3cbf37..d02fd83df6af 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -1028,7 +1028,6 @@ int doDump(Bundle* bundle) // These permissions are required by services implementing services // the system binds to (IME, Accessibility, PrintServices, etc.) bool hasBindDeviceAdminPermission = false; - bool hasBindInputMethodPermission = false; bool hasBindAccessibilityServicePermission = false; bool hasBindPrintServicePermission = false; bool hasBindNfcServicePermission = false; @@ -1757,7 +1756,6 @@ int doDump(Bundle* bundle) hasMetaHostPaymentCategory = false; hasMetaOffHostPaymentCategory = false; hasBindDeviceAdminPermission = false; - hasBindInputMethodPermission = false; hasBindAccessibilityServicePermission = false; hasBindPrintServicePermission = false; hasBindNfcServicePermission = false; @@ -1871,9 +1869,7 @@ int doDump(Bundle* bundle) String8 permission = AaptXml::getAttribute(tree, PERMISSION_ATTR, &error); if (error == "") { - if (permission == "android.permission.BIND_INPUT_METHOD") { - hasBindInputMethodPermission = true; - } else if (permission == + if (permission == "android.permission.BIND_ACCESSIBILITY_SERVICE") { hasBindAccessibilityServicePermission = true; } else if (permission == diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index b9de11b0026b..47750fc11a6e 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -2970,14 +2970,6 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<const ResourceFilter>& } e->setNameIndex(keyStrings.add(e->getName(), true)); - // If this entry has no values for other configs, - // and is the default config, then it is special. Otherwise - // we want to add it with the config info. - ConfigDescription* valueConfig = NULL; - if (N != 1 || config == nullConfig) { - valueConfig = &config; - } - status_t err = e->prepareFlatten(&valueStrings, this, &configTypeName, &config); if (err != NO_ERROR) { diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp index 23f6c88aad91..3787f3b96f08 100644 --- a/tools/aapt2/ResourceUtils.cpp +++ b/tools/aapt2/ResourceUtils.cpp @@ -51,8 +51,10 @@ std::optional<ResourceName> ToResourceName(const android::ResTable::resource_nam util::Utf16ToUtf8(StringPiece16(name_in.package, name_in.packageLen)); std::optional<ResourceNamedTypeRef> type; + std::string converted; if (name_in.type) { - type = ParseResourceNamedType(util::Utf16ToUtf8(StringPiece16(name_in.type, name_in.typeLen))); + converted = util::Utf16ToUtf8(StringPiece16(name_in.type, name_in.typeLen)); + type = ParseResourceNamedType(converted); } else if (name_in.type8) { type = ParseResourceNamedType(StringPiece(name_in.type8, name_in.typeLen)); } else { @@ -85,9 +87,10 @@ std::optional<ResourceName> ToResourceName(const android::AssetManager2::Resourc name_out.package = std::string(name_in.package, name_in.package_len); std::optional<ResourceNamedTypeRef> type; + std::string converted; if (name_in.type16) { - type = - ParseResourceNamedType(util::Utf16ToUtf8(StringPiece16(name_in.type16, name_in.type_len))); + converted = util::Utf16ToUtf8(StringPiece16(name_in.type16, name_in.type_len)); + type = ParseResourceNamedType(converted); } else if (name_in.type) { type = ParseResourceNamedType(StringPiece(name_in.type, name_in.type_len)); } else { diff --git a/tools/aapt2/SdkConstants.cpp b/tools/aapt2/SdkConstants.cpp index 8ea43abff895..34e8edb0a47f 100644 --- a/tools/aapt2/SdkConstants.cpp +++ b/tools/aapt2/SdkConstants.cpp @@ -27,7 +27,7 @@ namespace aapt { static ApiVersion sDevelopmentSdkLevel = 10000; static const auto sDevelopmentSdkCodeNames = - std::unordered_set<StringPiece>({"Q", "R", "S", "Sv2", "Tiramisu"}); + std::unordered_set<StringPiece>({"Q", "R", "S", "Sv2", "Tiramisu", "UpsideDownCake"}); static const std::vector<std::pair<uint16_t, ApiVersion>> sAttrIdMap = { {0x021c, 1}, diff --git a/tools/aapt2/cmd/Link.h b/tools/aapt2/cmd/Link.h index d8c76e297ec5..0170c4a4c54b 100644 --- a/tools/aapt2/cmd/Link.h +++ b/tools/aapt2/cmd/Link.h @@ -270,6 +270,8 @@ class LinkCommand : public Command { "Changes the name of the target package for overlay. Most useful\n" "when used in conjunction with --rename-manifest-package.", &options_.manifest_fixer_options.rename_overlay_target_package); + AddOptionalFlag("--rename-overlay-category", "Changes the category for the overlay.", + &options_.manifest_fixer_options.rename_overlay_category); AddOptionalFlagList("-0", "File suffix not to compress.", &options_.extensions_to_not_compress); AddOptionalSwitch("--no-compress", "Do not compress any resources.", diff --git a/tools/aapt2/format/Container.cpp b/tools/aapt2/format/Container.cpp index 9cef7b3d2ce3..1ff6c4996b91 100644 --- a/tools/aapt2/format/Container.cpp +++ b/tools/aapt2/format/Container.cpp @@ -76,7 +76,7 @@ bool ContainerWriter::AddResTableEntry(const pb::ResourceTable& table) { coded_out.WriteLittleEndian32(kResTable); // Write the aligned size. - const ::google::protobuf::uint64 size = table.ByteSize(); + const size_t size = table.ByteSizeLong(); const int padding = CalculatePaddingForAlignment(size); coded_out.WriteLittleEndian64(size); @@ -109,7 +109,7 @@ bool ContainerWriter::AddResFileEntry(const pb::internal::CompiledFile& file, coded_out.WriteLittleEndian32(kResFile); // Write the aligned size. - const ::google::protobuf::uint32 header_size = file.ByteSize(); + const size_t header_size = file.ByteSizeLong(); const int header_padding = CalculatePaddingForAlignment(header_size); const ::google::protobuf::uint64 data_size = in->TotalSize(); const int data_padding = CalculatePaddingForAlignment(data_size); diff --git a/tools/aapt2/io/Util.h b/tools/aapt2/io/Util.h index 5cb8206db23c..1b48a288d255 100644 --- a/tools/aapt2/io/Util.h +++ b/tools/aapt2/io/Util.h @@ -131,8 +131,7 @@ class ProtoInputStreamReader { template <typename T> bool ReadMessage(T *message) { ZeroCopyInputAdaptor adapter(in_); google::protobuf::io::CodedInputStream coded_stream(&adapter); - coded_stream.SetTotalBytesLimit(std::numeric_limits<int32_t>::max(), - coded_stream.BytesUntilTotalBytesLimit()); + coded_stream.SetTotalBytesLimit(std::numeric_limits<int32_t>::max()); return message->ParseFromCodedStream(&coded_stream); } diff --git a/tools/aapt2/link/ManifestFixer.cpp b/tools/aapt2/link/ManifestFixer.cpp index 948b11b6795e..42191912775a 100644 --- a/tools/aapt2/link/ManifestFixer.cpp +++ b/tools/aapt2/link/ManifestFixer.cpp @@ -449,13 +449,18 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor, manifest_action["attribution"]["inherit-from"]; manifest_action["original-package"]; manifest_action["overlay"].Action([&](xml::Element* el) -> bool { - if (!options_.rename_overlay_target_package) { - return true; + if (options_.rename_overlay_target_package) { + if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "targetPackage")) { + attr->value = options_.rename_overlay_target_package.value(); + } } - - if (xml::Attribute* attr = - el->FindAttribute(xml::kSchemaAndroid, "targetPackage")) { - attr->value = options_.rename_overlay_target_package.value(); + if (options_.rename_overlay_category) { + if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "category")) { + attr->value = options_.rename_overlay_category.value(); + } else { + el->attributes.push_back(xml::Attribute{xml::kSchemaAndroid, "category", + options_.rename_overlay_category.value()}); + } } return true; }); diff --git a/tools/aapt2/link/ManifestFixer.h b/tools/aapt2/link/ManifestFixer.h index d5d1d1770e1c..a8707d9d8623 100644 --- a/tools/aapt2/link/ManifestFixer.h +++ b/tools/aapt2/link/ManifestFixer.h @@ -48,6 +48,9 @@ struct ManifestFixerOptions { // <overlay>. std::optional<std::string> rename_overlay_target_package; + // The category to use instead of the one defined in 'android:category' in <overlay>. + std::optional<std::string> rename_overlay_category; + // The version name to set if 'android:versionName' is not defined in <manifest> or if // replace_version is set. std::optional<std::string> version_name_default; diff --git a/tools/aapt2/link/ManifestFixer_test.cpp b/tools/aapt2/link/ManifestFixer_test.cpp index 432f10bdab97..098d0be7f87d 100644 --- a/tools/aapt2/link/ManifestFixer_test.cpp +++ b/tools/aapt2/link/ManifestFixer_test.cpp @@ -351,6 +351,54 @@ TEST_F(ManifestFixerTest, EXPECT_THAT(attr->value, StrEq("com.android")); } +TEST_F(ManifestFixerTest, AddOverlayCategory) { + ManifestFixerOptions options; + options.rename_overlay_category = std::string("category"); + + std::unique_ptr<xml::XmlResource> doc = VerifyWithOptions(R"EOF( + <manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="android"> + <overlay android:targetName="Customization" android:targetPackage="android" /> + </manifest>)EOF", + options); + ASSERT_THAT(doc, NotNull()); + + xml::Element* manifest_el = doc->root.get(); + ASSERT_THAT(manifest_el, NotNull()); + + xml::Element* overlay_el = manifest_el->FindChild({}, "overlay"); + ASSERT_THAT(overlay_el, NotNull()); + + xml::Attribute* attr = overlay_el->FindAttribute(xml::kSchemaAndroid, "category"); + ASSERT_THAT(attr, NotNull()); + EXPECT_THAT(attr->value, StrEq("category")); +} + +TEST_F(ManifestFixerTest, OverrideOverlayCategory) { + ManifestFixerOptions options; + options.rename_overlay_category = std::string("category"); + + std::unique_ptr<xml::XmlResource> doc = VerifyWithOptions(R"EOF( + <manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="android"> + <overlay android:targetName="Customization" + android:targetPackage="android" + android:category="yrogetac"/> + </manifest>)EOF", + options); + ASSERT_THAT(doc, NotNull()); + + xml::Element* manifest_el = doc->root.get(); + ASSERT_THAT(manifest_el, NotNull()); + + xml::Element* overlay_el = manifest_el->FindChild({}, "overlay"); + ASSERT_THAT(overlay_el, NotNull()); + + xml::Attribute* attr = overlay_el->FindAttribute(xml::kSchemaAndroid, "category"); + ASSERT_THAT(attr, NotNull()); + EXPECT_THAT(attr->value, StrEq("category")); +} + TEST_F(ManifestFixerTest, UseDefaultVersionNameAndCode) { ManifestFixerOptions options; options.version_name_default = std::string("Beta"); diff --git a/tools/bit/adb.cpp b/tools/bit/adb.cpp index f521a63255e1..201028ba900a 100644 --- a/tools/bit/adb.cpp +++ b/tools/bit/adb.cpp @@ -73,7 +73,7 @@ string get_system_property(const string& name, int* err) { Command cmd("adb"); - cmd.AddArg("shell"); + cmd.AddArg("exec-out"); cmd.AddArg("getprop"); cmd.AddArg(name); @@ -278,7 +278,7 @@ run_instrumentation_test(const string& packageName, const string& runner, const InstrumentationCallbacks* callbacks) { Command cmd("adb"); - cmd.AddArg("shell"); + cmd.AddArg("exec-out"); cmd.AddArg("am"); cmd.AddArg("instrument"); cmd.AddArg("-w"); diff --git a/tools/bit/main.cpp b/tools/bit/main.cpp index fd184f50091a..0d48070fd0c6 100644 --- a/tools/bit/main.cpp +++ b/tools/bit/main.cpp @@ -52,24 +52,22 @@ struct Target { int testPassCount; int testFailCount; + int testIgnoreCount; int unknownFailureCount; // unknown failure == "Process crashed", etc. - bool actionsWithNoTests; Target(bool b, bool i, bool t, const string& p); }; Target::Target(bool b, bool i, bool t, const string& p) - :build(b), - install(i), - test(t), - pattern(p), - testActionCount(0), - testPassCount(0), - testFailCount(0), - unknownFailureCount(0), - actionsWithNoTests(false) -{ -} + : build(b), + install(i), + test(t), + pattern(p), + testActionCount(0), + testPassCount(0), + testFailCount(0), + testIgnoreCount(0), + unknownFailureCount(0) {} /** * Command line options. @@ -188,13 +186,12 @@ struct TestAction { // The number of tests that failed int failCount; + + // The number of tests that were ignored (because of @Ignore) + int ignoreCount; }; -TestAction::TestAction() - :passCount(0), - failCount(0) -{ -} +TestAction::TestAction() : passCount(0), failCount(0), ignoreCount(0) {} /** * Record for an activity that is going to be launched. @@ -278,7 +275,7 @@ TestResults::OnTestStatus(TestStatus& status) line << " of " << testCount; } } - line << ": " << m_currentAction->target->name << ':' << className << "\\#" << testName; + line << ": " << m_currentAction->target->name << ':' << className << "#" << testName; print_one_line("%s", line.str().c_str()); } else if ((resultCode == -1) || (resultCode == -2)) { // test failed @@ -286,9 +283,9 @@ TestResults::OnTestStatus(TestStatus& status) // all as "failures". m_currentAction->failCount++; m_currentAction->target->testFailCount++; - printf("%s\n%sFailed: %s:%s\\#%s%s\n", g_escapeClearLine, g_escapeRedBold, - m_currentAction->target->name.c_str(), className.c_str(), - testName.c_str(), g_escapeEndColor); + printf("%s\n%sFailed: %s:%s#%s%s\n", g_escapeClearLine, g_escapeRedBold, + m_currentAction->target->name.c_str(), className.c_str(), testName.c_str(), + g_escapeEndColor); bool stackFound; string stack = get_bundle_string(results, &stackFound, "stack", NULL); @@ -300,6 +297,13 @@ TestResults::OnTestStatus(TestStatus& status) } else if (stackFound) { printf("%s\n", stack.c_str()); } + } else if (resultCode == -3) { + // test ignored + m_currentAction->ignoreCount++; + m_currentAction->target->testIgnoreCount++; + printf("%s\n%sIgnored: %s:%s#%s%s\n", g_escapeClearLine, g_escapeYellowBold, + m_currentAction->target->name.c_str(), className.c_str(), testName.c_str(), + g_escapeEndColor); } } @@ -403,11 +407,14 @@ print_usage(FILE* out) { fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs all the\n"); fprintf(out, " tests in the ProtoOutputStreamBoolTest class.\n"); fprintf(out, "\n"); - fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\\#testWrite\n"); + fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest#testWrite\n"); fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n"); fprintf(out, " test method on that class.\n"); fprintf(out, "\n"); - fprintf(out, " bit CtsProtoTestCases:.ProtoOutputStreamBoolTest\\#testWrite,.ProtoOutputStreamBoolTest\\#testRepeated\n"); + fprintf(out, + " bit " + "CtsProtoTestCases:.ProtoOutputStreamBoolTest#testWrite,.ProtoOutputStreamBoolTest#" + "testRepeated\n"); fprintf(out, " Builds and installs CtsProtoTestCases.apk, and runs the testWrite\n"); fprintf(out, " and testRepeated test methods on that class.\n"); fprintf(out, "\n"); @@ -450,6 +457,35 @@ print_usage(FILE* out) { fprintf(out, "\n"); } +/** + * Prints a possibly color-coded summary of test results. Example output: + * + * "34 passed, 0 failed, 1 ignored\n" + */ +static void print_results(int passed, int failed, int ignored) { + char const* nothing = ""; + char const* cp = nothing; + char const* cf = nothing; + char const* ci = nothing; + + if (failed > 0) { + cf = g_escapeRedBold; + } else if (passed > 0 || ignored > 0) { + cp = passed > 0 ? g_escapeGreenBold : nothing; + ci = ignored > 0 ? g_escapeYellowBold : nothing; + } else { + cp = g_escapeYellowBold; + cf = g_escapeYellowBold; + } + + if (ignored > 0) { + printf("%s%d passed%s, %s%d failed%s, %s%d ignored%s\n", cp, passed, g_escapeEndColor, cf, + failed, g_escapeEndColor, ci, ignored, g_escapeEndColor); + } else { + printf("%s%d passed%s, %s%d failed%s\n", cp, passed, g_escapeEndColor, cf, failed, + g_escapeEndColor); + } +} /** * Sets the appropriate flag* variables. If there is a problem with the @@ -812,7 +848,7 @@ run_phases(vector<Target*> targets, const Options& options) // Stop & Sync if (!options.noRestart) { - err = run_adb("shell", "stop", NULL); + err = run_adb("exec-out", "stop", NULL); check_error(err); } err = run_adb("remount", NULL); @@ -831,9 +867,9 @@ run_phases(vector<Target*> targets, const Options& options) } else { print_status("Restarting the runtime"); - err = run_adb("shell", "setprop", "sys.boot_completed", "0", NULL); + err = run_adb("exec-out", "setprop", "sys.boot_completed", "0", NULL); check_error(err); - err = run_adb("shell", "start", NULL); + err = run_adb("exec-out", "start", NULL); check_error(err); } @@ -846,7 +882,7 @@ run_phases(vector<Target*> targets, const Options& options) sleep(2); } sleep(1); - err = run_adb("shell", "wm", "dismiss-keyguard", NULL); + err = run_adb("exec-out", "wm", "dismiss-keyguard", NULL); check_error(err); } } @@ -863,7 +899,7 @@ run_phases(vector<Target*> targets, const Options& options) continue; } // TODO: if (!apk.file.fileInfo.exists || apk.file.HasChanged()) - err = run_adb("shell", "mkdir", "-p", dir.c_str(), NULL); + err = run_adb("exec-out", "mkdir", "-p", dir.c_str(), NULL); check_error(err); err = run_adb("push", pushed.file.filename.c_str(), pushed.dest.c_str(), NULL); check_error(err); @@ -945,9 +981,9 @@ run_phases(vector<Target*> targets, const Options& options) } } if (runAll) { - err = run_adb("shell", installedPath.c_str(), NULL); + err = run_adb("exec-out", installedPath.c_str(), NULL); } else { - err = run_adb("shell", installedPath.c_str(), filterArg.c_str(), NULL); + err = run_adb("exec-out", installedPath.c_str(), filterArg.c_str(), NULL); } if (err == 0) { target->testPassCount++; @@ -1035,22 +1071,10 @@ run_phases(vector<Target*> targets, const Options& options) err = run_instrumentation_test(action.packageName, action.runner, action.className, &testResults); check_error(err); - if (action.passCount == 0 && action.failCount == 0) { - action.target->actionsWithNoTests = true; - } int total = action.passCount + action.failCount; printf("%sRan %d test%s for %s. ", g_escapeClearLine, total, total > 1 ? "s" : "", action.target->name.c_str()); - if (action.passCount == 0 && action.failCount == 0) { - printf("%s%d passed, %d failed%s\n", g_escapeYellowBold, action.passCount, - action.failCount, g_escapeEndColor); - } else if (action.failCount > 0) { - printf("%d passed, %s%d failed%s\n", action.passCount, g_escapeRedBold, - action.failCount, g_escapeEndColor); - } else { - printf("%s%d passed%s, %d failed\n", g_escapeGreenBold, action.passCount, - g_escapeEndColor, action.failCount); - } + print_results(action.passCount, action.failCount, action.ignoreCount); if (!testResults.IsSuccess()) { printf("\n%sTest didn't finish successfully: %s%s\n", g_escapeRedBold, testResults.GetErrorMessage().c_str(), g_escapeEndColor); @@ -1073,7 +1097,7 @@ run_phases(vector<Target*> targets, const Options& options) const ActivityAction& action = activityActions[0]; string componentName = action.packageName + "/" + action.className; - err = run_adb("shell", "am", "start", componentName.c_str(), NULL); + err = run_adb("exec-out", "am", "start", componentName.c_str(), NULL); check_error(err); } @@ -1147,17 +1171,11 @@ run_phases(vector<Target*> targets, const Options& options) printf(" %sUnknown failure, see above message.%s\n", g_escapeRedBold, g_escapeEndColor); hasErrors = true; - } else if (target->actionsWithNoTests) { - printf(" %s%d passed, %d failed%s\n", g_escapeYellowBold, - target->testPassCount, target->testFailCount, g_escapeEndColor); - hasErrors = true; - } else if (target->testFailCount > 0) { - printf(" %d passed, %s%d failed%s\n", target->testPassCount, - g_escapeRedBold, target->testFailCount, g_escapeEndColor); - hasErrors = true; } else { - printf(" %s%d passed%s, %d failed\n", g_escapeGreenBold, - target->testPassCount, g_escapeEndColor, target->testFailCount); + printf(" %s%s ", target->name.c_str(), + padding.c_str() + target->name.length()); + print_results(target->testPassCount, target->testFailCount, + target->testIgnoreCount); } } } diff --git a/tools/codegen/BUILD.bazel b/tools/codegen/BUILD.bazel new file mode 100644 index 000000000000..c14046d674dc --- /dev/null +++ b/tools/codegen/BUILD.bazel @@ -0,0 +1,21 @@ +# TODO(b/245731902): auto-generate these with bp2build. +load("@rules_kotlin//kotlin:jvm_library.bzl", "kt_jvm_library") + +java_binary( + name = "codegen_cli", + main_class = "com.android.codegen.MainKt", + runtime_deps = [ + ":codegen_cli_kt_lib", + ], +) + +kt_jvm_library( + name = "codegen_cli_kt_lib", + srcs = glob(["src/**/*.kt"]), + deps = ["//external/javaparser"], +) + +kt_jvm_library( + name = "codegen-version-info", + srcs = glob(["src/**/SharedConstants.kt"]), +) diff --git a/tools/fonts/Android.bp b/tools/fonts/Android.bp index eeb9e3ceda1e..f8629f9bd0b8 100644 --- a/tools/fonts/Android.bp +++ b/tools/fonts/Android.bp @@ -24,12 +24,7 @@ package { python_defaults { name: "fonts_python_defaults", version: { - py2: { - enabled: false, - embedded_launcher: false, - }, py3: { - enabled: true, embedded_launcher: true, }, }, diff --git a/tools/lint/Android.bp b/tools/lint/Android.bp index 17547ef8b561..260104145505 100644 --- a/tools/lint/Android.bp +++ b/tools/lint/Android.bp @@ -29,10 +29,17 @@ java_library_host { "auto_service_annotations", "lint_api", ], + kotlincflags: ["-Xjvm-default=all"], } java_test_host { name: "AndroidFrameworkLintCheckerTest", + // TODO(b/239881504): Since this test was written, Android + // Lint was updated, and now includes classes that were + // compiled for java 15. The soong build doesn't support + // java 15 yet, so we can't compile against "lint". Disable + // the test until java 15 is supported. + enabled: false, srcs: ["checks/src/test/java/**/*.kt"], static_libs: [ "AndroidFrameworkLintChecker", diff --git a/tools/lint/OWNERS b/tools/lint/OWNERS index 7c0451900e32..33e237d306fc 100644 --- a/tools/lint/OWNERS +++ b/tools/lint/OWNERS @@ -2,4 +2,8 @@ brufino@google.com jsharkey@google.com per-file *CallingSettingsNonUserGetterMethods* = file:/packages/SettingsProvider/OWNERS +per-file *RegisterReceiverFlagDetector* = jacobhobbie@google.com +# Android lint in the Android platform maintainers +colefaust@google.com +farivar@google.com diff --git a/tools/lint/checks/src/main/java/com/google/android/lint/EnforcePermissionDetector.kt b/tools/lint/checks/src/main/java/com/google/android/lint/EnforcePermissionDetector.kt index 8011b36c9a8f..8f553abfee31 100644 --- a/tools/lint/checks/src/main/java/com/google/android/lint/EnforcePermissionDetector.kt +++ b/tools/lint/checks/src/main/java/com/google/android/lint/EnforcePermissionDetector.kt @@ -65,8 +65,16 @@ class EnforcePermissionDetector : Detector(), SourceCodeScanner { if (attr1[i].name != attr2[i].name) { return false } - val v1 = ConstantEvaluator.evaluate(context, attr1[i].value) - val v2 = ConstantEvaluator.evaluate(context, attr2[i].value) + val value1 = attr1[i].value + val value2 = attr2[i].value + if (value1 == null && value2 == null) { + continue + } + if (value1 == null || value2 == null) { + return false + } + val v1 = ConstantEvaluator.evaluate(context, value1) + val v2 = ConstantEvaluator.evaluate(context, value2) if (v1 != v2) { return false } diff --git a/tools/localedata/OWNERS b/tools/localedata/OWNERS new file mode 100644 index 000000000000..2501679784d6 --- /dev/null +++ b/tools/localedata/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 24949 +include platform/external/icu:/OWNERS diff --git a/tools/localedata/extract_icu_data.py b/tools/localedata/extract_icu_data.py index ca1847af7d06..81ac897deae0 100755 --- a/tools/localedata/extract_icu_data.py +++ b/tools/localedata/extract_icu_data.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2016 The Android Open Source Project. All Rights Reserved. # @@ -61,7 +61,7 @@ def read_likely_subtags(input_file_name): # would be chosen.) } for line in input_file: - line = unicode(line, 'UTF-8').strip(u' \n\uFEFF').encode('UTF-8') + line = line.strip(u' \n\uFEFF') if line.startswith('//'): continue if '{' in line and '}' in line: @@ -118,26 +118,26 @@ def pack_to_uint32(locale): def dump_script_codes(all_scripts): """Dump the SCRIPT_CODES table.""" - print 'const char SCRIPT_CODES[][4] = {' + print('const char SCRIPT_CODES[][4] = {') for index, script in enumerate(all_scripts): - print " /* %-2d */ {'%c', '%c', '%c', '%c'}," % ( - index, script[0], script[1], script[2], script[3]) - print '};' - print + print(" /* %-2d */ {'%c', '%c', '%c', '%c'}," % ( + index, script[0], script[1], script[2], script[3])) + print('};') + print() def dump_script_data(likely_script_dict, all_scripts): """Dump the script data.""" - print - print 'const std::unordered_map<uint32_t, uint8_t> LIKELY_SCRIPTS({' + print() + print('const std::unordered_map<uint32_t, uint8_t> LIKELY_SCRIPTS({') for locale in sorted(likely_script_dict.keys()): script = likely_script_dict[locale] - print ' {0x%08Xu, %2du}, // %s -> %s' % ( + print(' {0x%08Xu, %2du}, // %s -> %s' % ( pack_to_uint32(locale), all_scripts.index(script), locale.replace('_', '-'), - script) - print '});' + script)) + print('});') def pack_to_uint64(locale): @@ -152,13 +152,13 @@ def pack_to_uint64(locale): def dump_representative_locales(representative_locales): """Dump the set of representative locales.""" - print - print 'std::unordered_set<uint64_t> REPRESENTATIVE_LOCALES({' + print() + print('std::unordered_set<uint64_t> REPRESENTATIVE_LOCALES({') for locale in sorted(representative_locales): - print ' 0x%08XLLU, // %s' % ( + print(' 0x%08XLLU, // %s' % ( pack_to_uint64(locale), - locale) - print '});' + locale)) + print('});') def read_and_dump_likely_data(icu_data_dir): @@ -220,30 +220,30 @@ def get_likely_script(locale, likely_script_dict): def dump_parent_data(script_organized_dict): """Dump information for parents of locales.""" sorted_scripts = sorted(script_organized_dict.keys()) - print + print() for script in sorted_scripts: parent_dict = script_organized_dict[script] print ('const std::unordered_map<uint32_t, uint32_t> %s_PARENTS({' % escape_script_variable_name(script.upper())) for locale in sorted(parent_dict.keys()): parent = parent_dict[locale] - print ' {0x%08Xu, 0x%08Xu}, // %s -> %s' % ( + print(' {0x%08Xu, 0x%08Xu}, // %s -> %s' % ( pack_to_uint32(locale), pack_to_uint32(parent), locale.replace('_', '-'), - parent.replace('_', '-')) - print '});' - print - - print 'const struct {' - print ' const char script[4];' - print ' const std::unordered_map<uint32_t, uint32_t>* map;' - print '} SCRIPT_PARENTS[] = {' + parent.replace('_', '-'))) + print('});') + print() + + print('const struct {') + print(' const char script[4];') + print(' const std::unordered_map<uint32_t, uint32_t>* map;') + print('} SCRIPT_PARENTS[] = {') for script in sorted_scripts: - print " {{'%c', '%c', '%c', '%c'}, &%s_PARENTS}," % ( + print(" {{'%c', '%c', '%c', '%c'}, &%s_PARENTS}," % ( script[0], script[1], script[2], script[3], - escape_script_variable_name(script.upper())) - print '};' + escape_script_variable_name(script.upper()))) + print('};') def dump_parent_tree_depth(parent_dict): @@ -256,8 +256,8 @@ def dump_parent_tree_depth(parent_dict): depth += 1 max_depth = max(max_depth, depth) assert max_depth < 5 # Our algorithms assume small max_depth - print - print 'const size_t MAX_PARENT_DEPTH = %d;' % max_depth + print() + print('const size_t MAX_PARENT_DEPTH = %d;' % max_depth) def read_and_dump_parent_data(icu_data_dir, likely_script_dict): @@ -281,8 +281,8 @@ def main(): source_root, 'external', 'icu', 'icu4c', 'source', 'data') - print '// Auto-generated by %s' % sys.argv[0] - print + print('// Auto-generated by %s' % sys.argv[0]) + print() likely_script_dict = read_and_dump_likely_data(icu_data_dir) read_and_dump_parent_data(icu_data_dir, likely_script_dict) diff --git a/tools/locked_region_code_injection/src/lockedregioncodeinjection/Utils.java b/tools/locked_region_code_injection/src/lockedregioncodeinjection/Utils.java index f1e84b1d8a33..b44e8b42f052 100644 --- a/tools/locked_region_code_injection/src/lockedregioncodeinjection/Utils.java +++ b/tools/locked_region_code_injection/src/lockedregioncodeinjection/Utils.java @@ -20,7 +20,7 @@ import java.util.List; public class Utils { - public static final int ASM_VERSION = Opcodes.ASM7; + public static final int ASM_VERSION = Opcodes.ASM9; /** * Reads a comma separated configuration similar to the Jack definition. diff --git a/tools/preload-check/AndroidTest.xml b/tools/preload-check/AndroidTest.xml index a0645d5b1051..d486f0f914c6 100644 --- a/tools/preload-check/AndroidTest.xml +++ b/tools/preload-check/AndroidTest.xml @@ -14,7 +14,7 @@ limitations under the License. --> <configuration description="Config for PreloadCheck"> - <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> + <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> <option name="cleanup" value="true" /> <option name="push" value="preload-check-device.jar->/data/local/tmp/preload-check-device.jar" /> </target_preparer> diff --git a/tools/preload-check/OWNERS b/tools/preload-check/OWNERS new file mode 100644 index 000000000000..e71c7332ca90 --- /dev/null +++ b/tools/preload-check/OWNERS @@ -0,0 +1 @@ +include /ZYGOTE_OWNERS diff --git a/tools/preload/loadclass/LoadClass.java b/tools/preload/loadclass/LoadClass.java index a71b6a8b145e..3f6658ab8c65 100644 --- a/tools/preload/loadclass/LoadClass.java +++ b/tools/preload/loadclass/LoadClass.java @@ -14,8 +14,8 @@ * limitations under the License. */ -import android.util.Log; import android.os.Debug; +import android.util.Log; /** * Loads a class, runs the garbage collector, and prints showmap output. @@ -28,7 +28,7 @@ class LoadClass { System.loadLibrary("android_runtime"); if (registerNatives() < 0) { - throw new RuntimeException("Error registering natives."); + throw new RuntimeException("Error registering natives."); } Debug.startAllocCounting(); @@ -46,7 +46,7 @@ class LoadClass { } } - System.gc(); + Runtime.getRuntime().gc(); int allocCount = Debug.getGlobalAllocCount(); int allocSize = Debug.getGlobalAllocSize(); @@ -73,7 +73,7 @@ class LoadClass { response.append(',').append(freedCount); response.append(',').append(freedSize); response.append(',').append(nativeHeapSize); - + System.out.println(response.toString()); } diff --git a/tools/processors/intdef_mappings/Android.bp b/tools/processors/intdef_mappings/Android.bp index 82a5dac21160..7059c52ddc76 100644 --- a/tools/processors/intdef_mappings/Android.bp +++ b/tools/processors/intdef_mappings/Android.bp @@ -7,27 +7,33 @@ package { default_applicable_licenses: ["frameworks_base_license"], } -java_plugin { - name: "intdef-annotation-processor", - - processor_class: "android.processor.IntDefProcessor", +java_library_host { + name: "libintdef-annotation-processor", srcs: [ ":framework-annotations", "src/**/*.java", - "src/**/*.kt" + "src/**/*.kt", ], use_tools_jar: true, } +java_plugin { + name: "intdef-annotation-processor", + + processor_class: "android.processor.IntDefProcessor", + + static_libs: ["libintdef-annotation-processor"], +} + java_test_host { name: "intdef-annotation-processor-test", srcs: [ "test/**/*.java", - "test/**/*.kt" - ], + "test/**/*.kt", + ], java_resource_dirs: ["test/resources"], static_libs: [ @@ -35,7 +41,7 @@ java_test_host { "truth-prebuilt", "junit", "guava", - "intdef-annotation-processor" + "libintdef-annotation-processor", ], test_suites: ["general-tests"], diff --git a/tools/processors/staledataclass/Android.bp b/tools/processors/staledataclass/Android.bp index 1e5097662a0a..2169c49a91a5 100644 --- a/tools/processors/staledataclass/Android.bp +++ b/tools/processors/staledataclass/Android.bp @@ -22,17 +22,13 @@ java_plugin { static_libs: [ "codegen-version-info", ], - // The --add-modules/exports flags below don't work for kotlinc yet, so pin this module to Java language level 8 (see b/139342589): - java_version: "1.8", - openjdk9: { - javacflags: [ - "--add-modules=jdk.compiler", - "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", - ], - }, + javacflags: [ + "--add-modules=jdk.compiler", + "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ], use_tools_jar: true, } diff --git a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt index 2e60f64b21e8..1cef5b0c8dfb 100644 --- a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt +++ b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt @@ -14,6 +14,7 @@ * limitations under the License. */ +@file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE") package android.processor.staledataclass @@ -97,7 +98,7 @@ class StaleDataclassProcessor: AbstractProcessor() { private fun elemToString(elem: Element): String { return buildString { - append(elem.modifiers.joinToString(" ") { it.name.toLowerCase() }) + append(elem.modifiers.joinToString(" ") { it.name.lowercase() }) append(" ") append(elem.annotationMirrors.joinToString(" ", transform = { annotationToString(it) })) append(" ") diff --git a/tools/processors/view_inspector/Android.bp b/tools/processors/view_inspector/Android.bp index ea9974f06a64..877a1d2b5fb3 100644 --- a/tools/processors/view_inspector/Android.bp +++ b/tools/processors/view_inspector/Android.bp @@ -7,10 +7,8 @@ package { default_applicable_licenses: ["frameworks_base_license"], } -java_plugin { - name: "view-inspector-annotation-processor", - - processor_class: "android.processor.view.inspector.PlatformInspectableProcessor", +java_library_host { + name: "libview-inspector-annotation-processor", srcs: ["src/java/**/*.java"], java_resource_dirs: ["src/resources"], @@ -23,6 +21,16 @@ java_plugin { use_tools_jar: true, } +java_plugin { + name: "view-inspector-annotation-processor", + + processor_class: "android.processor.view.inspector.PlatformInspectableProcessor", + + static_libs: [ + "libview-inspector-annotation-processor", + ], +} + java_test_host { name: "view-inspector-annotation-processor-test", @@ -32,7 +40,7 @@ java_test_host { static_libs: [ "junit", "guava", - "view-inspector-annotation-processor" + "libview-inspector-annotation-processor", ], test_suites: ["general-tests"], diff --git a/tools/protologtool/src/com/android/protolog/tool/CodeUtils.kt b/tools/protologtool/src/com/android/protolog/tool/CodeUtils.kt index a52c8042582b..451e514b8b33 100644 --- a/tools/protologtool/src/com/android/protolog/tool/CodeUtils.kt +++ b/tools/protologtool/src/com/android/protolog/tool/CodeUtils.kt @@ -29,7 +29,7 @@ object CodeUtils { */ fun hash(position: String, messageString: String, logLevel: LogLevel, logGroup: LogGroup): Int { return (position + messageString + logLevel.name + logGroup.name) - .map { c -> c.toInt() }.reduce { h, c -> h * 31 + c } + .map { c -> c.code }.reduce { h, c -> h * 31 + c } } fun checkWildcardStaticImported(code: CompilationUnit, className: String, fileName: String) { diff --git a/tools/sdkparcelables/src/com/android/sdkparcelables/Main.kt b/tools/sdkparcelables/src/com/android/sdkparcelables/Main.kt index 0fb062f280e3..0b619488c49c 100644 --- a/tools/sdkparcelables/src/com/android/sdkparcelables/Main.kt +++ b/tools/sdkparcelables/src/com/android/sdkparcelables/Main.kt @@ -39,7 +39,7 @@ fun main(args: Array<String>) { kotlin.system.exitProcess(2) } - val ancestorCollector = AncestorCollector(Opcodes.ASM7, null) + val ancestorCollector = AncestorCollector(Opcodes.ASM9, null) for (entry in zipFile.entries()) { if (entry.name.endsWith(".class")) { diff --git a/tools/stringslint/stringslint.py b/tools/stringslint/stringslint.py deleted file mode 100644 index 15088fc81e88..000000000000 --- a/tools/stringslint/stringslint.py +++ /dev/null @@ -1,234 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: utf-8 -*- - -# Copyright (C) 2018 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the 'License'); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an 'AS IS' BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Enforces common Android string best-practices. It ignores lint messages from -a previous strings file, if provided. - -Usage: stringslint.py strings.xml -Usage: stringslint.py strings.xml old_strings.xml - -In general: -* Errors signal issues that must be fixed before submitting, and are only - used when there are no false-positives. -* Warnings signal issues that might need to be fixed, but need manual - inspection due to risk of false-positives. -* Info signal issues that should be fixed to match best-practices, such - as providing comments to aid translation. -""" - -import re, sys, codecs -import lxml.etree as ET - -BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) - -def format(fg=None, bg=None, bright=False, bold=False, dim=False, reset=False): - # manually derived from http://en.wikipedia.org/wiki/ANSI_escape_code#Codes - codes = [] - if reset: codes.append("0") - else: - if not fg is None: codes.append("3%d" % (fg)) - if not bg is None: - if not bright: codes.append("4%d" % (bg)) - else: codes.append("10%d" % (bg)) - if bold: codes.append("1") - elif dim: codes.append("2") - else: codes.append("22") - return "\033[%sm" % (";".join(codes)) - -warnings = None - -def warn(tag, msg, actual, expected, color=YELLOW): - global warnings - key = "%s:%d" % (tag.attrib["name"], hash(msg)) - value = "%sLine %d: '%s':%s %s" % (format(fg=color, bold=True), - tag.sourceline, - tag.attrib["name"], - format(reset=True), - msg) - if not actual is None: value += "\n\tActual: %s%s%s" % (format(dim=True), - actual, - format(reset=True)) - if not expected is None: value += "\n\tExample: %s%s%s" % (format(dim=True), - expected, - format(reset=True)) - warnings[key] = value - - -def error(tag, msg, actual, expected): - warn(tag, msg, actual, expected, RED) - -def info(tag, msg, actual, expected): - warn(tag, msg, actual, expected, CYAN) - -# Escaping logic borrowed from https://stackoverflow.com/a/24519338 -ESCAPE_SEQUENCE_RE = re.compile(r''' - ( \\U........ # 8-digit hex escapes - | \\u.... # 4-digit hex escapes - | \\x.. # 2-digit hex escapes - | \\[0-7]{1,3} # Octal escapes - | \\N\{[^}]+\} # Unicode characters by name - | \\[\\'"abfnrtv] # Single-character escapes - )''', re.UNICODE | re.VERBOSE) - -def decode_escapes(s): - def decode_match(match): - return codecs.decode(match.group(0), 'unicode-escape') - - s = re.sub(r"\n\s*", " ", s) - s = ESCAPE_SEQUENCE_RE.sub(decode_match, s) - s = re.sub(r"%(\d+\$)?[a-z]", "____", s) - s = re.sub(r"\^\d+", "____", s) - s = re.sub(r"<br/?>", "\n", s) - s = re.sub(r"</?[a-z]+>", "", s) - return s - -def sample_iter(tag): - if not isinstance(tag, ET._Comment) and re.match("{.*xliff.*}g", tag.tag) and "example" in tag.attrib: - yield tag.attrib["example"] - elif tag.text: - yield decode_escapes(tag.text) - for e in tag: - for v in sample_iter(e): - yield v - if e.tail: - yield decode_escapes(e.tail) - -def lint(path): - global warnings - warnings = {} - - with open(path) as f: - raw = f.read() - if len(raw.strip()) == 0: - return warnings - tree = ET.fromstring(bytes(raw, encoding='utf-8')) - root = tree #tree.getroot() - - last_comment = None - for child in root: - # TODO: handle plurals - if isinstance(child, ET._Comment): - last_comment = child - elif child.tag == "string": - # We always consume comment - comment = last_comment - last_comment = None - - # Prepare string for analysis - text = "".join(child.itertext()) - sample = "".join(sample_iter(child)).strip().strip("'\"") - - # Validate comment - if comment is None: - info(child, "Missing string comment to aid translation", - None, None) - continue - if "do not translate" in comment.text.lower(): - continue - if "translatable" in child.attrib and child.attrib["translatable"].lower() == "false": - continue - - misspelled_attributes = [ - ("translateable", "translatable"), - ] - for misspelling, expected in misspelled_attributes: - if misspelling in child.attrib: - error(child, "Misspelled <string> attribute.", misspelling, expected) - - limit = re.search("CHAR[ _-]LIMIT=(\d+|NONE|none)", comment.text) - if limit is None: - info(child, "Missing CHAR LIMIT to aid translation", - repr(comment), "<!-- Description of string [CHAR LIMIT=32] -->") - elif re.match("\d+", limit.group(1)): - limit = int(limit.group(1)) - if len(sample) > limit: - warn(child, "Expanded string length is larger than CHAR LIMIT", - sample, None) - - # Look for common mistakes/substitutions - if "'" in text: - error(child, "Turned quotation mark glyphs are more polished", - text, "This doesn\u2019t need to \u2018happen\u2019 today") - if '"' in text and not text.startswith('"') and text.endswith('"'): - error(child, "Turned quotation mark glyphs are more polished", - text, "This needs to \u201chappen\u201d today") - if "..." in text: - error(child, "Ellipsis glyph is more polished", - text, "Loading\u2026") - if "wi-fi" in text.lower(): - error(child, "Non-breaking glyph is more polished", - text, "Wi\u2011Fi") - if "wifi" in text.lower(): - error(child, "Using non-standard spelling", - text, "Wi\u2011Fi") - if re.search("\d-\d", text): - warn(child, "Ranges should use en dash glyph", - text, "You will find this material in chapters 8\u201312") - if "--" in text: - warn(child, "Phrases should use em dash glyph", - text, "Upon discovering errors\u2014all 124 of them\u2014they recalled.") - if ". " in text: - warn(child, "Only use single space between sentences", - text, "First idea. Second idea.") - if re.match(r"^[A-Z\s]{5,}$", text): - warn(child, "Actions should use android:textAllCaps in layout; ignore if acronym", - text, "Refresh data") - if " phone " in text and "product" not in child.attrib: - warn(child, "Strings mentioning phones should have variants for tablets", - text, None) - - # When more than one substitution, require indexes - if len(re.findall("%[^%]", text)) > 1: - if len(re.findall("%[^\d]", text)) > 0: - error(child, "Substitutions must be indexed", - text, "Add %1$s to %2$s") - - # Require xliff substitutions - for gc in child.iter(): - badsub = False - if gc.tail and re.search("%[^%]", gc.tail): badsub = True - if re.match("{.*xliff.*}g", gc.tag): - if "id" not in gc.attrib: - error(child, "Substitutions must define id attribute", - None, "<xliff:g id=\"domain\" example=\"example.com\">%1$s</xliff:g>") - if "example" not in gc.attrib: - error(child, "Substitutions must define example attribute", - None, "<xliff:g id=\"domain\" example=\"example.com\">%1$s</xliff:g>") - else: - if gc.text and re.search("%[^%]", gc.text): badsub = True - if badsub: - error(child, "Substitutions must be inside xliff tags", - text, "<xliff:g id=\"domain\" example=\"example.com\">%1$s</xliff:g>") - - return warnings - -if len(sys.argv) > 2: - before = lint(sys.argv[2]) -else: - before = {} -after = lint(sys.argv[1]) - -for b in before: - if b in after: - del after[b] - -if len(after) > 0: - for a in sorted(after.keys()): - print(after[a]) - print() - sys.exit(1) diff --git a/tools/stringslint/stringslint_sha.sh b/tools/stringslint/stringslint_sha.sh index bd0569873197..009a1f284bf0 100755 --- a/tools/stringslint/stringslint_sha.sh +++ b/tools/stringslint/stringslint_sha.sh @@ -1,5 +1,3 @@ #!/bin/bash -LOCAL_DIR="$( dirname ${BASH_SOURCE} )" -git show --name-only --pretty=format: $1 | grep values/strings.xml | while read file; do - python3 $LOCAL_DIR/stringslint.py <(git show $1:$file) <(git show $1^:$file) -done + +# NOTE: this script has been deprecated and replaced by AyeAye checks directly in Gerrit diff --git a/tools/traceinjection/src/com/android/traceinjection/TraceInjectionClassVisitor.java b/tools/traceinjection/src/com/android/traceinjection/TraceInjectionClassVisitor.java index 863f976b8aff..67c5561f348d 100644 --- a/tools/traceinjection/src/com/android/traceinjection/TraceInjectionClassVisitor.java +++ b/tools/traceinjection/src/com/android/traceinjection/TraceInjectionClassVisitor.java @@ -28,7 +28,7 @@ public class TraceInjectionClassVisitor extends ClassVisitor { private final TraceInjectionConfiguration mParams; public TraceInjectionClassVisitor(ClassVisitor classVisitor, TraceInjectionConfiguration params) { - super(Opcodes.ASM7, classVisitor); + super(Opcodes.ASM9, classVisitor); mParams = params; } diff --git a/tools/traceinjection/src/com/android/traceinjection/TraceInjectionMethodAdapter.java b/tools/traceinjection/src/com/android/traceinjection/TraceInjectionMethodAdapter.java index c2bbddcb5668..91e987dc72ee 100644 --- a/tools/traceinjection/src/com/android/traceinjection/TraceInjectionMethodAdapter.java +++ b/tools/traceinjection/src/com/android/traceinjection/TraceInjectionMethodAdapter.java @@ -61,7 +61,7 @@ public class TraceInjectionMethodAdapter extends AdviceAdapter { public TraceInjectionMethodAdapter(MethodVisitor methodVisitor, int access, String name, String descriptor, TraceInjectionConfiguration params) { - super(Opcodes.ASM7, methodVisitor, access, name, descriptor); + super(Opcodes.ASM9, methodVisitor, access, name, descriptor); mParams = params; mIsConstructor = "<init>".equals(name); } @@ -157,7 +157,7 @@ public class TraceInjectionMethodAdapter extends AdviceAdapter { class TracingAnnotationVisitor extends AnnotationVisitor { TracingAnnotationVisitor(AnnotationVisitor annotationVisitor) { - super(Opcodes.ASM7, annotationVisitor); + super(Opcodes.ASM9, annotationVisitor); } @Override diff --git a/tools/validatekeymaps/OWNERS b/tools/validatekeymaps/OWNERS index 0313a40f7270..4c20c4dc9d35 100644 --- a/tools/validatekeymaps/OWNERS +++ b/tools/validatekeymaps/OWNERS @@ -1,2 +1 @@ -michaelwr@google.com -svv@google.com +include /INPUT_OWNERS |