Repository navigation
Hide TestOutputHandler via annotations in AndroidX Test. - #2532
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_1015650486
branch
from
November 7, 2026 03:58
155c4a5 to
9ee5606
Compare
Mark `TestOutputHandler` with `@RestrictTo(Scope.LIBRARY)` in open-source exports (via `copybara:insert`) and with a package-private internal `@HideFromApi` annotation in google3 so Metalava and Dackka exclude it without relying on `@hide` Javadoc tags. In google3, external test harnesses still implement `TestOutputHandler` (so active `@RestrictTo` triggers ErrorProne `RestrictToEnforcer`), and package-level filtering cannot be used on `androidx.test.internal.platform.util` because `TestOutputEmitter` in the same package is part of `monitor`'s `current_internal.txt`. Using annotations instead of `@hide` doc tags: - Unlocks passing `--ignore-comments` on API signature generation, improving build performance and memory usage by skipping Javadoc/KDoc comment extraction and AST parsing. - Enables Metalava declarative `<api-surfaces>` XML configuration, which ignores `@hide` and `@removed` Javadoc tags by design. - Enforces `@RestrictTo(Scope.LIBRARY)` statically for external callers. PiperOrigin-RevId: 1015650486
copybara-service
Bot
force-pushed
the
piper_1015650486
branch
from
November 7, 2026 04:11
9ee5606 to
e4c1fe6
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 TestOutputHandler via annotations in AndroidX Test.
Mark
TestOutputHandlerwith@RestrictTo(Scope.LIBRARY)inopen-source exports (via
copybara:insert) and with a package-privateinternal
@HideFromApiannotation in google3 so Metalava and Dackkaexclude it without relying on
@hideJavadoc tags.In google3, external test harnesses still implement
TestOutputHandler(so active
@RestrictTotriggers ErrorProneRestrictToEnforcer), andpackage-level filtering cannot be used on
androidx.test.internal.platform.utilbecauseTestOutputEmitterinthe same package is part of
monitor'scurrent_internal.txt.Using annotations instead of
@hidedoc tags:--ignore-commentson API signature generation,improving build performance and memory usage by skipping Javadoc/KDoc
comment extraction and AST parsing.
<api-surfaces>XML configuration,which ignores
@hideand@removedJavadoc tags by design.@RestrictTo(Scope.LIBRARY)statically for external callers.