Add new task flag when starting chooser activity in bug report.

This flag is required whenever starting an activity from a
non-activity context.

Change-Id: Ia77e6e7801d712a20d407bc2ac92e543bc287010
Fixes: 62016780
Test: Click on generated bug report notification
This commit is contained in:
Bryce Lee
2017-05-23 09:02:09 -07:00
parent ff389264d9
commit 6483b86a92

View File

@@ -981,6 +981,8 @@ public class BugreportProgressService extends Service {
// Since we may be launched behind lockscreen, make sure that ChooserActivity doesn't finish
// itself in onStop.
chooserIntent.putExtra(ChooserActivity.EXTRA_PRIVATE_RETAIN_IN_ON_STOP, true);
// Starting the activity from a service.
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(chooserIntent);
}