OSDN Git Service

Sharesheet - Photos -> Sharesheet in work profile crashes
authorMatt Pietal <mpietal@google.com>
Tue, 2 Apr 2019 14:10:22 +0000 (10:10 -0400)
committerMatt Pietal <mpietal@google.com>
Tue, 2 Apr 2019 14:10:22 +0000 (10:10 -0400)
The issue stems from adding the incorrect userid when first entering
the sharesheet. The flow from Photos sendkit directly to the work
profile sharesheet was setting the incorrect userid on the content
uris. Move this logic to the correct location.

Bug: 129280812
Test: Manually retest Photos->Share->Work Profile->Chat
Change-Id: I3660684336450172852cf86bea1f3c60cf15aa87

core/java/com/android/internal/app/ChooserActivity.java
core/java/com/android/internal/app/IntentForwarderActivity.java

index 07d28eb..326e1cc 100644 (file)
@@ -938,8 +938,6 @@ public class ChooserActivity extends ResolverActivity {
         if (isSendAction(in)) {
             in.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                     Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
-
-            in.fixUris(getUserId());
         }
     }
 
index 3811fe4..a5f055f 100644 (file)
@@ -115,6 +115,7 @@ public class IntentForwarderActivity extends Activity  {
                 // At this point, innerIntent is not null. Otherwise, canForward would have returned
                 // false.
                 innerIntent.prepareToLeaveUser(callingUserId);
+                innerIntent.fixUris(callingUserId);
             } else {
                 newIntent.prepareToLeaveUser(callingUserId);
             }