File tree Expand file tree Collapse file tree
tests/PhotoPicker/src/android/photopicker/cts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import android .content .Context ;
2121import android .content .Intent ;
2222import android .content .pm .PackageManager ;
23+ import android .os .UserHandle ;
2324import android .util .Log ;
2425
2526import 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
You can’t perform that action at this time.
0 commit comments