Loading core/java/android/content/Intent.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -6181,8 +6181,12 @@ public class Intent implements Parcelable, Cloneable { * who sent the intent. * who sent the intent. * @hide * @hide */ */ public void setContentUserHint(int contentUserHint) { public void prepareToLeaveUser(int userId) { mContentUserHint = contentUserHint; // If mContentUserHint is not UserHandle.USER_CURRENT, the intent has already left a user. // We want mContentUserHint to refer to the original user, so don't do anything. if (mContentUserHint == UserHandle.USER_CURRENT) { mContentUserHint = userId; } } } /** /** Loading core/java/com/android/internal/app/IntentForwarderActivity.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -87,9 +87,9 @@ public class IntentForwarderActivity extends Activity { if (canForward(newIntent, targetUserId)) { if (canForward(newIntent, targetUserId)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); innerIntent.setContentUserHint(callingUserId); innerIntent.prepareToLeaveUser(callingUserId); } else { } else { newIntent.setContentUserHint(callingUserId); newIntent.prepareToLeaveUser(callingUserId); } } final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser( final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser( Loading services/core/java/com/android/server/am/ActivityStack.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2829,7 +2829,7 @@ final class ActivityStack { + " res=" + resultCode + " data=" + resultData); + " res=" + resultCode + " data=" + resultData); if (resultTo.userId != r.userId) { if (resultTo.userId != r.userId) { if (resultData != null) { if (resultData != null) { resultData.setContentUserHint(r.userId); resultData.prepareToLeaveUser(r.userId); } } } } if (r.info.applicationInfo.uid > 0) { if (r.info.applicationInfo.uid > 0) { Loading Loading
core/java/android/content/Intent.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -6181,8 +6181,12 @@ public class Intent implements Parcelable, Cloneable { * who sent the intent. * who sent the intent. * @hide * @hide */ */ public void setContentUserHint(int contentUserHint) { public void prepareToLeaveUser(int userId) { mContentUserHint = contentUserHint; // If mContentUserHint is not UserHandle.USER_CURRENT, the intent has already left a user. // We want mContentUserHint to refer to the original user, so don't do anything. if (mContentUserHint == UserHandle.USER_CURRENT) { mContentUserHint = userId; } } } /** /** Loading
core/java/com/android/internal/app/IntentForwarderActivity.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -87,9 +87,9 @@ public class IntentForwarderActivity extends Activity { if (canForward(newIntent, targetUserId)) { if (canForward(newIntent, targetUserId)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { if (newIntent.getAction().equals(Intent.ACTION_CHOOSER)) { Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); Intent innerIntent = (Intent) newIntent.getParcelableExtra(Intent.EXTRA_INTENT); innerIntent.setContentUserHint(callingUserId); innerIntent.prepareToLeaveUser(callingUserId); } else { } else { newIntent.setContentUserHint(callingUserId); newIntent.prepareToLeaveUser(callingUserId); } } final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser( final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser( Loading
services/core/java/com/android/server/am/ActivityStack.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2829,7 +2829,7 @@ final class ActivityStack { + " res=" + resultCode + " data=" + resultData); + " res=" + resultCode + " data=" + resultData); if (resultTo.userId != r.userId) { if (resultTo.userId != r.userId) { if (resultData != null) { if (resultData != null) { resultData.setContentUserHint(r.userId); resultData.prepareToLeaveUser(r.userId); } } } } if (r.info.applicationInfo.uid > 0) { if (r.info.applicationInfo.uid > 0) { Loading