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
This commit is contained in:
Nicolas Prevot
2014-10-31 12:01:32 +00:00
parent 5b820a8aa1
commit c4fc00a58d

View File

@@ -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;
}
}
}