Merge "Do not stop wallpaper chooser activity"

This commit is contained in:
TreeHugger Robot
2018-06-21 19:24:32 +00:00
committed by Android (Google) Code Review
3 changed files with 2 additions and 33 deletions

View File

@@ -16,7 +16,6 @@
package com.android.settings.wallpaper;
import android.app.Fragment;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -36,18 +35,13 @@ import androidx.preference.PreferenceScreen;
public class WallpaperTypePreferenceController extends BasePreferenceController
implements LifecycleObserver, OnStart {
private Fragment mParentFragment;
private PreferenceScreen mScreen;
public WallpaperTypePreferenceController(Context context, String key) {
super(context, key);
}
public void setParentFragment(Fragment parentFragment) {
mParentFragment = parentFragment;
}
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
@@ -64,8 +58,7 @@ public class WallpaperTypePreferenceController extends BasePreferenceController
if (preference.getIntent() == null) {
return super.handlePreferenceTreeClick(preference);
}
mParentFragment.startActivity(preference.getIntent());
mParentFragment.getActivity().finish();
mContext.startActivity(preference.getIntent());
return true;
}

View File

@@ -55,12 +55,6 @@ public class WallpaperTypeSettings extends DashboardFragment {
return R.xml.wallpaper_settings;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
use(WallpaperTypePreferenceController.class).setParentFragment(this);
}
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override