conditionally add FLAG_ACTIVITY_NEW_TASK when starting page

Subsettings must be started from Activity context, apparently.

Add a flag when it's not started from Activity context. This might not
be catching all cases but should at lesat cover most of them.

Change-Id: I8157ec0cb3d032bb44a0e7dec36637906fc8f1a0
Fixes: 72314527
Test: monkey
This commit is contained in:
Fan Zhang
2018-01-22 14:07:52 -08:00
parent aaf307e71d
commit b7270a5aeb

View File

@@ -515,7 +515,8 @@ public final class Utils extends com.android.settingslib.Utils {
Fragment resultTo, int resultRequestCode, String titleResPackageName, int titleResId,
CharSequence title, boolean isShortcut, int metricsCategory) {
startWithFragment(context, fragmentName, args, resultTo, resultRequestCode,
titleResPackageName, titleResId, title, isShortcut, metricsCategory, 0);
titleResPackageName, titleResId, title, isShortcut, metricsCategory,
Intent.FLAG_ACTIVITY_NEW_TASK);
}