Merge "Do not stop wallpaper chooser activity"
This commit is contained in:
committed by
Android (Google) Code Review
commit
869daffb61
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user