Launch WallpaperPicker in a new task[Part2]

Didn't notice com.android.settings.Settings$WallpaperSettingsActivity was also change unexpectedly, we should only add new task for CustomizationPickerActivity only.

Test: Manually
Fixes: 158642941
Change-Id: I9b271d0fbf124d2d38bc52fa99c2c17b0bfc658c
This commit is contained in:
Chihhang Chuang
2020-06-16 18:38:04 +08:00
parent 8bed8d3454
commit 786e814706

View File

@@ -92,8 +92,11 @@ public class WallpaperPreferenceController extends BasePreferenceController {
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (getPreferenceKey().equals(preference.getKey())) {
preference.getContext().startActivity(new Intent().setComponent(getComponentName())
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
final Intent intent = new Intent().setComponent(getComponentName());
if (areStylesAvailable()) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
preference.getContext().startActivity(intent);
return true;
}
return super.handlePreferenceTreeClick(preference);