Clear WallpaperPicker task before launch

There are different launch sources to start WallpaperPicker, clear
previous task to prevent keeping old activity.

Bug: 177638480
Test: make RunSettingsRoboTests
Change-Id: Ia4d3d5c7e5df4a5d3acb137f644939c079d5028f
This commit is contained in:
Kunhung Li
2021-03-15 09:48:22 +08:00
parent 45726b937b
commit 5f2cf8e695
2 changed files with 17 additions and 1 deletions

View File

@@ -105,7 +105,7 @@ public class TopLevelWallpaperPreferenceController extends BasePreferenceControl
final Intent intent = new Intent().setComponent(
getComponentName()).putExtra(mWallpaperLaunchExtra, LAUNCHED_SETTINGS);
if (areStylesAvailable()) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
}
preference.getContext().startActivity(intent);
return true;