Skip to content

Commit 10abebe

Browse files
brettchabotcopybara-androidxtest
authored andcommitted
Move auxiliary test storage classes to internal APIs from experimental.
PiperOrigin-RevId: 628457412
1 parent 3377b35 commit 10abebe

File tree

8 files changed

+41
-116
lines changed

8 files changed

+41
-116
lines changed

services/storage/java/androidx/test/services/storage/BUILD

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
55
load("//build_extensions:api_checks.bzl", "api_checks")
6-
load("//build_extensions:dackka_test.bzl", "dackka_test")
76
load("//build_extensions/maven:axt_android_aar.bzl", "axt_android_aar")
87
load("//build_extensions/maven:maven_artifact.bzl", "maven_artifact")
98

@@ -44,7 +43,7 @@ java_library(
4443
name = "test_storage_constants",
4544
srcs = ["TestStorageConstants.java"],
4645
deps = [
47-
"//annotation",
46+
"//opensource/androidx:annotation",
4847
],
4948
)
5049

@@ -78,11 +77,12 @@ maven_artifact(
7877
target = ":test_storage_aar",
7978
)
8079

81-
dackka_test(
82-
name = "test_storage_doc",
83-
runtime_dep = ":storage",
84-
src_jar = ":test_storage_aar-src.jar",
85-
)
80+
# no public documentation
81+
# dackka_test(
82+
# name = "test_storage_doc",
83+
# runtime_dep = ":storage",
84+
# src_jar = ":test_storage_aar-src.jar",
85+
# )
8686

8787
api_checks(
8888
name = "storage_api",

services/storage/java/androidx/test/services/storage/TestStorage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
* <p>Users should ideally not reference this class directly, but rather retrieve the
5555
* PlatformTestStorage implementation appropriate for their execution environment from {@link
5656
* androidx.test.platform.io.PlatformTestStorageRegistry}.
57+
*
58+
* @hide
5759
*/
5860
@RestrictTo(Scope.LIBRARY_GROUP)
5961
public final class TestStorage implements PlatformTestStorage {

services/storage/java/androidx/test/services/storage/TestStorageConstants.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
*/
1616
package androidx.test.services.storage;
1717

18-
import androidx.test.annotation.ExperimentalTestApi;
18+
import androidx.annotation.RestrictTo;
19+
import androidx.annotation.RestrictTo.Scope;
1920

20-
/** Holds constants that are shared between on-device and host-side testing infrastructure. */
21-
@ExperimentalTestApi
21+
/**
22+
* Holds constants that are shared between on-device and host-side testing infrastructure.
23+
*
24+
* @hide
25+
*/
26+
@RestrictTo(Scope.LIBRARY)
2227
public final class TestStorageConstants {
2328

2429
/** The parent folder name for all the test related files. */

services/storage/java/androidx/test/services/storage/TestStorageException.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
*/
1616
package androidx.test.services.storage;
1717

18-
import androidx.test.annotation.ExperimentalTestApi;
18+
import androidx.annotation.RestrictTo;
19+
import androidx.annotation.RestrictTo.Scope;
1920

20-
/** A RuntimeException thrown out of the test storage service. */
21-
@ExperimentalTestApi
21+
/**
22+
* A RuntimeException thrown out of the test storage service.
23+
*
24+
* @hide
25+
*/
26+
@RestrictTo(Scope.LIBRARY_GROUP)
2227
public class TestStorageException extends RuntimeException {
2328

2429
public TestStorageException(String message) {
Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1 @@
11
// Signature format: 3.0
2-
package androidx.test.services.storage {
3-
4-
public final class TestStorage implements androidx.test.platform.io.PlatformTestStorage {
5-
ctor public TestStorage();
6-
ctor public TestStorage(android.content.ContentResolver);
7-
method public void addOutputProperties(java.util.Map<java.lang.String!,java.io.Serializable!>!);
8-
method public String! getInputArg(String);
9-
method public java.util.Map<java.lang.String!,java.lang.String!>! getInputArgs();
10-
method public android.net.Uri! getInputFileUri(String);
11-
method public android.net.Uri! getOutputFileUri(String);
12-
method public java.util.Map<java.lang.String!,java.io.Serializable!>! getOutputProperties();
13-
method public boolean isTestStorageFilePath(String);
14-
method public java.io.InputStream! openInputFile(String) throws java.io.FileNotFoundException;
15-
method public java.io.OutputStream! openOutputFile(String) throws java.io.FileNotFoundException;
16-
method public java.io.OutputStream! openOutputFile(String, boolean) throws java.io.FileNotFoundException;
17-
}
18-
19-
@androidx.test.annotation.ExperimentalTestApi public final class TestStorageConstants {
20-
field public static final String INTERNAL_USE_PROVIDER_AUTHORITY = "androidx.test.services.storage._internal_use_files";
21-
field public static final String ON_DEVICE_FIXTURE_SCRIPTS = "googletest/fixture_scripts/";
22-
field public static final String ON_DEVICE_PATH_INTERNAL_USE = "googletest/internal_use/";
23-
field public static final String ON_DEVICE_PATH_ROOT = "googletest/";
24-
field public static final String ON_DEVICE_PATH_TEST_OUTPUT = "googletest/test_outputfiles/";
25-
field public static final String ON_DEVICE_PATH_TEST_PROPERTIES = "googletest/test_exportproperties/";
26-
field public static final String ON_DEVICE_TEST_RUNFILES = "googletest/test_runfiles/";
27-
field public static final String OUTPUT_PROPERTIES_PROVIDER_AUTHORITY = "androidx.test.services.storage.properties";
28-
field public static final String TEST_ARGS_FILE_NAME = "test_args.dat";
29-
field public static final String TEST_ARGS_PROVIDER_AUTHORITY = "androidx.test.services.storage.testargs";
30-
field public static final String TEST_OUTPUT_PROVIDER_AUTHORITY = "androidx.test.services.storage.outputfiles";
31-
field public static final String TEST_RUNFILES_PROVIDER_AUTHORITY = "androidx.test.services.storage.runfiles";
32-
}
33-
34-
@androidx.test.annotation.ExperimentalTestApi public class TestStorageException extends java.lang.RuntimeException {
35-
ctor public TestStorageException(String!);
36-
ctor public TestStorageException(String!, Throwable!);
37-
}
38-
39-
}
40-
41-
package androidx.test.services.storage.file {
42-
43-
@androidx.test.annotation.ExperimentalTestApi public final class HostedFile {
44-
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.HostedFile.FileHost!, String!);
45-
method public static java.io.File! getInputRootDirectory(android.content.Context!);
46-
method public static java.io.File! getOutputRootDirectory(android.content.Context!);
47-
}
48-
49-
public enum HostedFile.FileHost {
50-
method public String! getAuthority();
51-
method public boolean isWritable();
52-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost EXPORT_PROPERTIES;
53-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost INTERNAL_USE_ONLY;
54-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost OUTPUT;
55-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileHost TEST_FILE;
56-
}
57-
58-
public enum HostedFile.FileType {
59-
method public static androidx.test.services.storage.file.HostedFile.FileType! fromTypeCode(String!);
60-
method public String! getTypeCode();
61-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileType DIRECTORY;
62-
enum_constant public static final androidx.test.services.storage.file.HostedFile.FileType FILE;
63-
}
64-
65-
public enum HostedFile.HostedFileColumn {
66-
method public int getAndroidType();
67-
method public String! getColumnName();
68-
method public static String![]! getColumnNames();
69-
method public Class<?>! getColumnType();
70-
method public int getPosition();
71-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn DATA;
72-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn DISPLAY_NAME;
73-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn NAME;
74-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn SIZE;
75-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn SIZE_2;
76-
enum_constant public static final androidx.test.services.storage.file.HostedFile.HostedFileColumn TYPE;
77-
}
78-
79-
@androidx.test.annotation.ExperimentalTestApi public final class PropertyFile {
80-
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.PropertyFile.Authority!);
81-
method public static android.net.Uri! buildUri(androidx.test.services.storage.file.PropertyFile.Authority!, String!);
82-
}
83-
84-
public enum PropertyFile.Authority {
85-
method public String! getAuthority();
86-
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Authority TEST_ARGS;
87-
}
88-
89-
public enum PropertyFile.Column {
90-
method public String! getName();
91-
method public static String![]! getNames();
92-
method public int getPosition();
93-
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Column NAME;
94-
enum_constant public static final androidx.test.services.storage.file.PropertyFile.Column VALUE;
95-
}
96-
97-
}
98-

services/storage/java/androidx/test/services/storage/file/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ android_library(
1414
name = "file",
1515
srcs = glob(["*.java"]),
1616
deps = [
17-
"//annotation",
17+
"//opensource/androidx:annotation",
1818
"//runner/monitor",
1919
"//services/storage/java/androidx/test/services/storage:test_storage_constants",
2020
],

services/storage/java/androidx/test/services/storage/file/HostedFile.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@
2222
import android.os.UserManager;
2323
import android.provider.OpenableColumns;
2424
import android.util.Log;
25-
import androidx.test.annotation.ExperimentalTestApi;
2625
import androidx.test.services.storage.TestStorageConstants;
2726
import java.io.File;
2827

29-
/** Constants to access hosted file data and convenience methods for building Uris. */
30-
@ExperimentalTestApi
28+
import androidx.annotation.RestrictTo;
29+
import androidx.annotation.RestrictTo.Scope;
30+
31+
/**
32+
* Constants to access hosted file data and convenience methods for building Uris.
33+
*
34+
* @hide
35+
*/
36+
@RestrictTo(Scope.LIBRARY)
3137
public final class HostedFile {
3238

3339
private static final String TAG = "HostedFile";

services/storage/java/androidx/test/services/storage/file/PropertyFile.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@
1818
import static androidx.test.internal.util.Checks.checkNotNull;
1919

2020
import android.net.Uri;
21-
import androidx.test.annotation.ExperimentalTestApi;
2221
import androidx.test.services.storage.TestStorageConstants;
2322

23+
import androidx.annotation.RestrictTo;
24+
import androidx.annotation.RestrictTo.Scope;
25+
2426
/**
2527
* Constants to access property file data (holding name/value pairs) and convenience methods for
2628
* build URIs.
29+
*
30+
* @hide
2731
*/
28-
@ExperimentalTestApi
32+
@RestrictTo(Scope.LIBRARY)
2933
public final class PropertyFile {
3034

3135
/** Represents columns returned by the property file service. */

0 commit comments

Comments
 (0)