Repository navigation
Hide @RestrictTo APIs in AndroidX Test Metalava API generation. - #2531
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
piper_1015649620
branch
from
November 7, 2026 03:58
44719e4 to
73c4399
Compare
Pass `--hide-annotation androidx.annotation.RestrictTo` in `generate_api.bzl` (alongside the existing `--show-annotation` for `RestrictTo(Scope.LIBRARY_GROUP)` on internal API checks) and update the two `current_public.txt` files where `@RestrictTo` declarations had leaked into the public signature surface: - `espresso`: Remove `IInteractionExecutionStatus` (`.aidl` annotated with `@RestrictTo(Scope.LIBRARY_GROUP)` via `@JavaPassthrough`, which leaked into `current_public.txt` after the AIDL compiler stopped emitting `@hide` in generated Javadoc comments). - `monitor`: Elide internal `@RestrictTo(Scope.LIBRARY)` superclass `ExposedInstrumentationApi` on `MonitoringInstrumentation` (loaded from compiled classpath bytecode where Javadoc `@hide` is absent) to `android.app.Instrumentation`. Hiding internal APIs via `@RestrictTo` instead of `@hide` doc tags: - Unlocks removing redundant `@hide` tags and passing `--ignore-comments` to Metalava, improving build performance and memory usage by skipping Javadoc/KDoc comment parsing. - Enables Metalava declarative `<api-surfaces>` XML configuration, which ignores `@hide` and `@removed` Javadoc tags by design. - Aligns Metalava visibility with compiler, Lint, and IDE enforcement. PiperOrigin-RevId: 1015649620
copybara-service
Bot
force-pushed
the
piper_1015649620
branch
from
November 7, 2026 04:10
73c4399 to
d24d30e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hide @RestrictTo APIs in AndroidX Test Metalava API generation.
Pass
--hide-annotation androidx.annotation.RestrictToingenerate_api.bzl(alongside the existing--show-annotationforRestrictTo(Scope.LIBRARY_GROUP)on internal API checks) and update thetwo
current_public.txtfiles where@RestrictTodeclarations hadleaked into the public signature surface:
espresso: RemoveIInteractionExecutionStatus(.aidlannotatedwith
@RestrictTo(Scope.LIBRARY_GROUP)via@JavaPassthrough, whichleaked into
current_public.txtafter the AIDL compiler stoppedemitting
@hidein generated Javadoc comments).monitor: Elide internal@RestrictTo(Scope.LIBRARY)superclassExposedInstrumentationApionMonitoringInstrumentation(loadedfrom compiled classpath bytecode where Javadoc
@hideis absent) toandroid.app.Instrumentation.Hiding internal APIs via
@RestrictToinstead of@hidedoc tags:@hidetags and passing--ignore-commentsto Metalava, improving build performance andmemory usage by skipping Javadoc/KDoc comment parsing.
<api-surfaces>XML configuration,which ignores
@hideand@removedJavadoc tags by design.