Merge "Passing activity token for identify sourceTask" into udc-dev am: 3a94c396de

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22883539

Change-Id: Ifcaa51d5cbe06f02f13be8ed67188edf37ce96a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeff Chang
2023-05-12 17:01:12 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.annotation.UserHandleAware;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.AppOpsManager.Mode;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
@@ -110,8 +111,8 @@ public class CrossProfileApps {
component,
targetUser.getIdentifier(),
true,
null,
null);
mContext.getActivityToken(),
ActivityOptions.makeBasic().toBundle());
} catch (RemoteException ex) {
throw ex.rethrowFromSystemServer();
}

View File

@@ -147,7 +147,7 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {
if (launchMainActivity) {
launchIntent.setAction(Intent.ACTION_MAIN);
launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
if (targetTask == null) {
if (targetTask == null || options != null) {
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
} else {