Add flag FLAG_ACTIVITY_RESET_TASK_IF_NEEDED in LauncherAppsService.

Without this fix:
When starting an activity that was an activity-alias, in the work profile:
If this activity was already running, it caused the activity to be
created a second time instead of restarting the first one.

BUG:21411331

Change-Id: Ieb323885c589caed2675765cd5eed8c311535b92
This commit is contained in:
Nicolas Prevot
2015-06-26 13:45:12 -07:00
parent 5869363b06
commit b683019745

View File

@@ -271,7 +271,8 @@ public class LauncherAppsService extends SystemService {
Intent launchIntent = new Intent(Intent.ACTION_MAIN);
launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
launchIntent.setSourceBounds(sourceBounds);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
launchIntent.setPackage(component.getPackageName());
long ident = Binder.clearCallingIdentity();
@@ -470,4 +471,4 @@ public class LauncherAppsService extends SystemService {
}
}
}
}
}