From d9655d65d6d2113840cd30dd03059d886053bdc6 Mon Sep 17 00:00:00 2001 From: Paige McAuliffe Date: Tue, 19 Dec 2023 13:52:32 -0800 Subject: [PATCH] Fix Espresso Device doc generation warnings PiperOrigin-RevId: 592334740 --- espresso/device/CHANGELOG.md | 1 + .../java/androidx/test/espresso/device/BUILD | 6 ++-- .../test/espresso/device/DeviceInteraction.kt | 28 +++++++++++-------- .../espresso/device/action/DeviceActions.kt | 16 +++++------ 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/espresso/device/CHANGELOG.md b/espresso/device/CHANGELOG.md index 292ccfcaa..c8e20203d 100644 --- a/espresso/device/CHANGELOG.md +++ b/espresso/device/CHANGELOG.md @@ -7,6 +7,7 @@ **Bug Fixes** * Add better error messaging when process does not have INTERNET permission +* Make exception class references in Espresso Device documentation clickable links **New Features** diff --git a/espresso/device/java/androidx/test/espresso/device/BUILD b/espresso/device/java/androidx/test/espresso/device/BUILD index f73206d55..0f88d7f7e 100644 --- a/espresso/device/java/androidx/test/espresso/device/BUILD +++ b/espresso/device/java/androidx/test/espresso/device/BUILD @@ -1,11 +1,11 @@ # Description: # EspressoDevice - the new Synchronized Device State Change API for Android. +load("//build_extensions:api_checks.bzl", "api_checks") +load("//build_extensions:dackka_test.bzl", "dackka_test") load("//build_extensions:kt_android_library.bzl", "kt_android_library") load("//build_extensions/maven:axt_android_aar.bzl", "axt_android_aar") load("//build_extensions/maven:maven_artifact.bzl", "maven_artifact") -load("//build_extensions:dackka_test.bzl", "dackka_test") -load("//build_extensions:api_checks.bzl", "api_checks") load("@build_bazel_rules_android//android:rules.bzl", "android_library") licenses(["notice"]) @@ -35,7 +35,6 @@ kt_android_library( "//espresso/device/java/androidx/test/espresso/device/sizeclass", ], deps = [ - "//annotation/java/androidx/test/annotation", "//espresso/device/java/androidx/test/espresso/device/action", "//espresso/device/java/androidx/test/espresso/device/dagger", "//espresso/device/java/androidx/test/espresso/device/sizeclass", @@ -50,6 +49,7 @@ android_library( testonly = 1, custom_package = "androidx.test.espresso.device", manifest = "AndroidManifest.xml", + visibility = ["//:__subpackages__"], exports = [ ":device", "//espresso/device/java/androidx/test/espresso/device/action", diff --git a/espresso/device/java/androidx/test/espresso/device/DeviceInteraction.kt b/espresso/device/java/androidx/test/espresso/device/DeviceInteraction.kt index bf04aabf8..10f866326 100644 --- a/espresso/device/java/androidx/test/espresso/device/DeviceInteraction.kt +++ b/espresso/device/java/androidx/test/espresso/device/DeviceInteraction.kt @@ -29,9 +29,7 @@ import androidx.test.internal.util.Checks.checkNotMainThread import androidx.test.platform.device.DeviceController import javax.inject.Inject -/** - * API surface for performing device-centric operations. - */ +/** API surface for performing device-centric operations. */ class DeviceInteraction @Inject constructor(private val deviceController: DeviceController) { /** @@ -57,8 +55,10 @@ class DeviceInteraction @Inject constructor(private val deviceController: Device * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real + * device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when + * called on a non-foldable Emulator. */ fun DeviceInteraction.setTabletopMode(): DeviceInteraction { perform(getSetTabletopModeDeviceAction()) @@ -73,8 +73,10 @@ class DeviceInteraction @Inject constructor(private val deviceController: Device * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real + * device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when + * called on a non-foldable Emulator. */ fun DeviceInteraction.setBookMode(): DeviceInteraction { perform(getSetBookModeDeviceAction()) @@ -88,8 +90,10 @@ class DeviceInteraction @Inject constructor(private val deviceController: Device * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real + * device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when + * called on a non-foldable Emulator. */ fun DeviceInteraction.setFlatMode(): DeviceInteraction { perform(getSetFlatModeDeviceAction()) @@ -102,8 +106,10 @@ class DeviceInteraction @Inject constructor(private val deviceController: Device * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real + * device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when + * called on a non-foldable Emulator. */ fun DeviceInteraction.setClosedMode(): DeviceInteraction { perform(getSetClosedModeDeviceAction()) diff --git a/espresso/device/java/androidx/test/espresso/device/action/DeviceActions.kt b/espresso/device/java/androidx/test/espresso/device/action/DeviceActions.kt index be4eba5e0..ba5b4fa82 100644 --- a/espresso/device/java/androidx/test/espresso/device/action/DeviceActions.kt +++ b/espresso/device/java/androidx/test/espresso/device/action/DeviceActions.kt @@ -33,8 +33,8 @@ import androidx.test.espresso.device.sizeclass.WidthSizeClass * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when called on a non-foldable Emulator. */ fun setTabletopMode(): DeviceAction { return TabletopModeAction() @@ -48,8 +48,8 @@ fun setTabletopMode(): DeviceAction { * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when called on a non-foldable Emulator. */ fun setBookMode(): DeviceAction { return BookModeAction() @@ -62,8 +62,8 @@ fun setBookMode(): DeviceAction { * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when called on a non-foldable Emulator. */ fun setFlatMode(): DeviceAction { return FlatModeAction() @@ -75,8 +75,8 @@ fun setFlatMode(): DeviceAction { * This action is for foldable devices only. Currently only supported for tests run on Android * Emulators. * - * @throws UnsupportedDeviceOperationException if used on a real device. - * @throws DeviceControllerOperationException when called on a non-foldable Emulator. + * @throws androidx.test.platform.device.UnsupportedDeviceOperationException if used on a real device. + * @throws androidx.test.espresso.device.controller.DeviceControllerOperationException when called on a non-foldable Emulator. */ fun setClosedMode(): DeviceAction { return ClosedModeAction()