Skip to content

Commit 60c9fcc

Browse files
Sahana RaoShubhi Saxena
authored andcommitted
Add --user to content commands
Bug: 267327327 Test: atest android.photopicker.cts.CloudPhotoPickerTest (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0be073e8676c27647d98e1b0f006a65cd57b26ed) Merged-In: I0115329837dc91c8d684e324b8a6e2ad0d7e53a5 Change-Id: I0115329837dc91c8d684e324b8a6e2ad0d7e53a5
1 parent 7049e7f commit 60c9fcc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/PhotoPicker/src/android/photopicker/cts/PhotoPickerBaseTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.content.Context;
2121
import android.content.Intent;
2222
import android.content.pm.PackageManager;
23+
import android.os.UserHandle;
2324
import android.util.Log;
2425

2526
import androidx.annotation.Nullable;
@@ -86,11 +87,15 @@ static boolean isHardwareSupported() {
8687
protected static void setCloudProvider(@Nullable String authority) throws Exception {
8788
if (authority == null) {
8889
sDevice.executeShellCommand(
89-
"content call --uri content://media/ --method set_cloud_provider --extra"
90+
"content call"
91+
+ " --user " + UserHandle.myUserId()
92+
+ " --uri content://media/ --method set_cloud_provider --extra"
9093
+ " cloud_provider:n:null");
9194
} else {
9295
sDevice.executeShellCommand(
93-
"content call --uri content://media/ --method set_cloud_provider --extra"
96+
"content call"
97+
+ " --user " + UserHandle.myUserId()
98+
+ " --uri content://media/ --method set_cloud_provider --extra"
9499
+ " cloud_provider:s:"
95100
+ authority);
96101
}
@@ -99,7 +104,9 @@ protected static void setCloudProvider(@Nullable String authority) throws Except
99104
protected static String getCurrentCloudProvider() throws IOException {
100105
final String out =
101106
sDevice.executeShellCommand(
102-
"content call --uri content://media/ --method get_cloud_provider");
107+
"content call"
108+
+ " --user " + UserHandle.myUserId()
109+
+ " --uri content://media/ --method get_cloud_provider");
103110
return extractCloudProvider(out);
104111
}
105112

0 commit comments

Comments
 (0)