Eagerly dispose app env generated for the other KT UAST plugin

Until we fully switch to K2 UAST, there is a chance that users' AGP
modules run Lint with different KT UAST plugin, e.g., with manual
opt-out per-module while global opt-in, or depending on language
version (after b/333565234).

At Ie6595f4a35ecc6b59bff7c3466ec9345ad4742c3, we cleared cached KT UAST
plugin, but in AGP gradle daemon, the overall application environment
can still exist, resulting in app-level service conflict.
In this commit, UastEnvironment creation will check if there is such
sticky app env that is created for the other KT UAST plugin, and if so,
eagerly dispose it so that the newly created UastEnvironment will use
the fresh app env.

Aside from that, FE1.0 service registration is sealed with app lock.

Bug: 323029887
Bug: 333731151
Bug: 333565234
Test: manual lint runs on MyApplication65 from ag/26948216
Test: bazel test \
  //tools/base/lint/libs/lint-tests:tests.test \
  $(bazel query 'kind("lint_test rule", //tools/...)')
Change-Id: I62f984181fdaf46963b6c1c1fd88ba39198f1427
3 files changed
tree: d27d38da3b327a3eb0e94131f141a451ac35b454
  1. .idea/
  2. adb-proxy/
  3. adblib/
  4. adblib-ddmlibcompatibility/
  5. adblib-tools/
  6. annotations/
  7. apkparser/
  8. app-inspection/
  9. apps/
  10. aspects_agent/
  11. bazel/
  12. build-analyzer/
  13. build-system/
  14. chunkio/
  15. chunkio-processor/
  16. common/
  17. ddmlib/
  18. debugger-tests/
  19. debuggers/
  20. deploy/
  21. device-provisioner/
  22. device_validator/
  23. draw9patch/
  24. dynamic-layout-inspector/
  25. echo-sample/
  26. emulator/
  27. environment-services/
  28. external-annotations/
  29. fakeadbserver/
  30. fakeandroid/
  31. firebase/
  32. flags/
  33. game-tools/
  34. gmaven/
  35. intellij-bazel/
  36. intellij-native/
  37. jaxb-inheritance-plugin/
  38. jdwp-packet/
  39. jdwp-scache/
  40. jdwp-tracer/
  41. jobb/
  42. kotlin-multiplatform-models/
  43. layoutlib-api/
  44. layoutlib-extensions/
  45. legacy/
  46. lint/
  47. manifest-parser/
  48. misc/
  49. mlkit-common/
  50. multipreview-asm/
  51. ninepatch/
  52. owners/
  53. perf-logger/
  54. perflib/
  55. pixelprobe/
  56. preview/
  57. process-monitor/
  58. profgen/
  59. profiler/
  60. repository/
  61. resource-repository/
  62. sdk-common/
  63. sdklib/
  64. signflinger/
  65. standalone-render/
  66. studio-grpc-testutils/
  67. testing-infrastructure/
  68. testutils/
  69. third_party/
  70. threading-agent/
  71. threading-agent-callback/
  72. tracer/
  73. transport/
  74. usb-devices/
  75. utp/
  76. vector-drawable-tool/
  77. wizard/
  78. yourkit-controller/
  79. zipflinger/
  80. .editorconfig
  81. .gitignore
  82. adt.iml
  83. BUILD.bazel
  84. contributing.md
  85. navbar.md
  86. PREUPLOAD.cfg
  87. README.md
  88. source.md
  89. studio.md
README.md

tools/base

This project contains:

  • Common libraries that are shared between any of the IDE (Android Studio), the build system (The Android Gradle Plugin) and SDK components that will be released from studio-main (e.g. the standalone SDK manager). This includes:
    • Instant-run-libraries
    • SDK management libraries
    • The manifest merger
    • Common libraries
    • Common test utilites
  • The build system
  • The new profiler