More CTS for APIs used by Mainline.
Bug: 150641862, 150641715, 150641138, 150640123 Test: atest cts/tests/tests/content/src/android/content/cts/ContentResolverTest.java Test: atest cts/tests/tests/os/src/android/os/cts/BinderTest.java Test: atest cts/tests/tests/provider/src/android/provider/cts/DocumentsContractTest.java Test: atest cts/tests/tests/provider/src/android/provider/cts/media/MediaStoreTest.java Change-Id: I6f9ae1dcffd79fd6c422962d9ca64d4b98841766
This commit is contained in:
committed by
Jeff Sharkey
parent
fb2441b808
commit
9ed18340ca
@@ -23,6 +23,7 @@ import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.annotation.UserIdInt;
|
||||
@@ -4014,6 +4015,10 @@ public abstract class ContentResolver implements ContentInterface {
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
// We can't accept an already-opened FD here, since these methods are
|
||||
// rewriting actual filesystem paths
|
||||
@SuppressLint("StreamFiles")
|
||||
public static @NonNull Uri decodeFromFile(@NonNull File file) {
|
||||
return translateDeprecatedDataPath(file.getAbsolutePath());
|
||||
}
|
||||
@@ -4030,6 +4035,10 @@ public abstract class ContentResolver implements ContentInterface {
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
// We can't accept an already-opened FD here, since these methods are
|
||||
// rewriting actual filesystem paths
|
||||
@SuppressLint("StreamFiles")
|
||||
public static @NonNull File encodeToFile(@NonNull Uri uri) {
|
||||
return new File(translateDeprecatedDataPath(uri));
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import static com.android.internal.util.Preconditions.checkCollectionNotEmpty;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.ContentInterface;
|
||||
import android.content.ContentProvider;
|
||||
@@ -1303,6 +1304,7 @@ public final class DocumentsContract {
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static @NonNull Uri setManageMode(@NonNull Uri uri) {
|
||||
Preconditions.checkNotNull(uri, "uri can not be null");
|
||||
return uri.buildUpon().appendQueryParameter(PARAM_MANAGE, "true").build();
|
||||
@@ -1314,6 +1316,7 @@ public final class DocumentsContract {
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static boolean isManageMode(@NonNull Uri uri) {
|
||||
Preconditions.checkNotNull(uri, "uri can not be null");
|
||||
return uri.getBooleanQueryParameter(PARAM_MANAGE, false);
|
||||
|
||||
Reference in New Issue
Block a user