Skip to content

Commit

Permalink
Move auxiliary test storage classes to internal APIs from experimental.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 627866071
  • Loading branch information
brettchabot authored and copybara-androidxtest committed Apr 25, 2024
1 parent 3a23fe9 commit 7844ace
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 32 deletions.
2 changes: 1 addition & 1 deletion services/storage/java/androidx/test/services/storage/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ java_library(
name = "test_storage_constants",
srcs = ["TestStorageConstants.java"],
deps = [
"//annotation",
"//opensource/androidx:annotation",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
* <p>Users should ideally not reference this class directly, but rather retrieve the
* PlatformTestStorage implementation appropriate for their execution environment from {@link
* androidx.test.platform.io.PlatformTestStorageRegistry}.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY_GROUP)
public final class TestStorage implements PlatformTestStorage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
*/
package androidx.test.services.storage;

import androidx.test.annotation.ExperimentalTestApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/** Holds constants that are shared between on-device and host-side testing infrastructure. */
@ExperimentalTestApi
/**
* Holds constants that are shared between on-device and host-side testing infrastructure.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY)
public final class TestStorageConstants {

/** The parent folder name for all the test related files. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
*/
package androidx.test.services.storage;

import androidx.test.annotation.ExperimentalTestApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/** A RuntimeException thrown out of the test storage service. */
@ExperimentalTestApi
/**
* A RuntimeException thrown out of the test storage service.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY_GROUP)
public class TestStorageException extends RuntimeException {

public TestStorageException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
// Signature format: 3.0
package androidx.test.services.storage {

public final class TestStorage implements androidx.test.platform.io.PlatformTestStorage {
ctor public TestStorage();
ctor public TestStorage(android.content.ContentResolver);
method public void addOutputProperties(java.util.Map<java.lang.String!,java.io.Serializable!>!);
method public String! getInputArg(String);
method public java.util.Map<java.lang.String!,java.lang.String!>! getInputArgs();
method public android.net.Uri! getInputFileUri(String);
method public android.net.Uri! getOutputFileUri(String);
method public java.util.Map<java.lang.String!,java.io.Serializable!>! getOutputProperties();
method public boolean isTestStorageFilePath(String);
method public java.io.InputStream! openInputFile(String) throws java.io.FileNotFoundException;
method public java.io.OutputStream! openOutputFile(String) throws java.io.FileNotFoundException;
method public java.io.OutputStream! openOutputFile(String, boolean) throws java.io.FileNotFoundException;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android_library(
name = "file",
srcs = glob(["*.java"]),
deps = [
"//annotation",
"//opensource/androidx:annotation",
"//runner/monitor",
"//services/storage/java/androidx/test/services/storage:test_storage_constants",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
import android.os.UserManager;
import android.provider.OpenableColumns;
import android.util.Log;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.services.storage.TestStorageConstants;
import java.io.File;

/** Constants to access hosted file data and convenience methods for building Uris. */
@ExperimentalTestApi
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/**
* Constants to access hosted file data and convenience methods for building Uris.
*
* @hide
*/
@RestrictTo(Scope.LIBRARY)
public final class HostedFile {

private static final String TAG = "HostedFile";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
import static androidx.test.internal.util.Checks.checkNotNull;

import android.net.Uri;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.services.storage.TestStorageConstants;

import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;

/**
* Constants to access property file data (holding name/value pairs) and convenience methods for
* build URIs.
*
* @hide
*/
@ExperimentalTestApi
@RestrictTo(Scope.LIBRARY)
public final class PropertyFile {

/** Represents columns returned by the property file service. */
Expand Down

0 comments on commit 7844ace

Please sign in to comment.