From c4fc00a58d1a8a2e3bffd15f447c2ada82913bfa Mon Sep 17 00:00:00 2001 From: Nicolas Prevot Date: Fri, 31 Oct 2014 12:01:32 +0000 Subject: [PATCH] Do not fix uris inside the system. When we fix uris by adding the user id they belong to, the extras of the intent are unpacked and repacked. This must not happen inside the system process. It happened when ResolverActivity was handling an activity intent coming from a different user. BUG:18198630 Change-Id: I869897013bb2e5522584b404e87a8f20e7943b60 --- core/java/android/content/Intent.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 7676e4b8d6fc3..e06f034c1570e 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -41,6 +41,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; +import android.os.Process; import android.os.StrictMode; import android.os.UserHandle; import android.provider.DocumentsContract; @@ -7498,8 +7499,10 @@ public class Intent implements Parcelable, Cloneable { */ public void prepareToEnterProcess() { if (mContentUserHint != UserHandle.USER_CURRENT) { - fixUris(mContentUserHint); - mContentUserHint = UserHandle.USER_CURRENT; + if (UserHandle.getAppId(Process.myUid()) != Process.SYSTEM_UID) { + fixUris(mContentUserHint); + mContentUserHint = UserHandle.USER_CURRENT; + } } }