Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3855d6e5 authored by Yi-Ling Chuang's avatar Yi-Ling Chuang
Browse files

Launch activities in another task if the metadata is set.

Add FLAG_ACTIVITY_NEW_TASK to the intent if META_DATA_LAUNCH_NEW_TASK is
set to true to make it launch a separate task.

Bug: 197702494
Bug: 197700978
Bug: 197702789
Test: Set this metadata to true and make sure this page is launched in another task.
Change-Id: I3b4e5745e940a3db5db6be51e17a9c505915e3c0
parent 02b3384a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -421,6 +421,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
        ProfileSelectDialog.updateUserHandlesIfNeeded(mContext, tile);
        mMetricsFeatureProvider.logStartedIntent(intent, sourceMetricCategory);

        //TODO(b/201970810): Add test cases.
        if (tile.isNewTask(mContext)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }

        if (tile.userHandle == null || tile.isPrimaryProfileOnly()) {
            activity.startActivity(intent);
        } else if (tile.userHandle.size() == 1) {