Merge "Rename createContentUriAsUser to createContentUriForUser" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5b4e1622b7
@@ -56,7 +56,7 @@ package android.app.usage {
|
|||||||
package android.content {
|
package android.content {
|
||||||
|
|
||||||
public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
|
public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
|
||||||
method @NonNull public static android.net.Uri createContentUriAsUser(@NonNull android.net.Uri, @NonNull android.os.UserHandle);
|
method @NonNull public static android.net.Uri createContentUriForUser(@NonNull android.net.Uri, @NonNull android.os.UserHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class Context {
|
public abstract class Context {
|
||||||
|
|||||||
@@ -2655,7 +2655,7 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||||
public static Uri createContentUriAsUser(
|
public static Uri createContentUriForUser(
|
||||||
@NonNull Uri contentUri, @NonNull UserHandle userHandle) {
|
@NonNull Uri contentUri, @NonNull UserHandle userHandle) {
|
||||||
if (!ContentResolver.SCHEME_CONTENT.equals(contentUri.getScheme())) {
|
if (!ContentResolver.SCHEME_CONTENT.equals(contentUri.getScheme())) {
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ public class ContentProviderTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateContentUriAsUser() {
|
public void testCreateContentUriForUser() {
|
||||||
Uri uri = Uri.parse("content://com.example/foo/bar");
|
Uri uri = Uri.parse("content://com.example/foo/bar");
|
||||||
Uri expectedUri = Uri.parse("content://7@com.example/foo/bar");
|
Uri expectedUri = Uri.parse("content://7@com.example/foo/bar");
|
||||||
assertEquals(expectedUri, ContentProvider.createContentUriAsUser(uri, UserHandle.of(7)));
|
assertEquals(expectedUri, ContentProvider.createContentUriForUser(uri, UserHandle.of(7)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user