The Android Gradle Plugin provides support for bytecode transformations through its TransformAction and transformClassesWith APIs, which allow developers to instrument classes at compile-time. The Sentry Android Gradle plugin utilizes these APIs to inject spans into Room queries, measuring their execution time. By using the new AGP transform APIs with ASM, developers can instrument classes without affecting build speed, handling full/incremental builds on their own. The plugin registers a custom ClassVisitorFactory to create and register custom ClassVisitors for instrumentation, which are used to measure the execution time of Room queries.