Skip to content

Commit 7f78a35

Browse files
Hide TestOutputHandler via annotations in AndroidX Test.
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
1 parent 761fb9e commit 7f78a35

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎runner/monitor/java/androidx/test/internal/platform/util/TestOutputHandler.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package androidx.test.internal.platform.util;
1717

18+
import androidx.annotation.RestrictTo;
19+
import androidx.annotation.RestrictTo.Scope;
1820
import java.io.Serializable;
1921
import java.util.Map;
2022

@@ -25,6 +27,7 @@
2527
*
2628
* @hide
2729
*/
30+
@RestrictTo(Scope.LIBRARY)
2831
public interface TestOutputHandler {
2932

3033
/** Output the stack traces of all running threads back to the execution environment. */

0 commit comments

Comments
 (0)