Merge "Passing activity token for identify sourceTask" into udc-dev
This commit is contained in:
@@ -27,6 +27,7 @@ import android.annotation.SystemApi;
|
|||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.annotation.UserHandleAware;
|
import android.annotation.UserHandleAware;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.ActivityOptions;
|
||||||
import android.app.AppOpsManager.Mode;
|
import android.app.AppOpsManager.Mode;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -110,8 +111,8 @@ public class CrossProfileApps {
|
|||||||
component,
|
component,
|
||||||
targetUser.getIdentifier(),
|
targetUser.getIdentifier(),
|
||||||
true,
|
true,
|
||||||
null,
|
mContext.getActivityToken(),
|
||||||
null);
|
ActivityOptions.makeBasic().toBundle());
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
throw ex.rethrowFromSystemServer();
|
throw ex.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {
|
|||||||
if (launchMainActivity) {
|
if (launchMainActivity) {
|
||||||
launchIntent.setAction(Intent.ACTION_MAIN);
|
launchIntent.setAction(Intent.ACTION_MAIN);
|
||||||
launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
if (targetTask == null) {
|
if (targetTask == null || options != null) {
|
||||||
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
|
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user