[Catalyst] Rebind restricted preferences for SettingsPreferenceFragment
Bug: 377600992 Fix: 397357248 Flag: com.android.settings.flags.catalyst Test: manual Change-Id: I4ce83d8032d9ef8730dec5efd61f9834f2433983
This commit is contained in:
@@ -48,13 +48,11 @@ import com.android.settings.core.CategoryMixin.CategoryListener;
|
||||
import com.android.settings.core.PreferenceControllerListHelper;
|
||||
import com.android.settings.flags.Flags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.restriction.UserRestrictionBindingHelper;
|
||||
import com.android.settingslib.PrimarySwitchPreference;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.drawer.DashboardCategory;
|
||||
import com.android.settingslib.drawer.Tile;
|
||||
import com.android.settingslib.preference.PreferenceScreenBindingHelper;
|
||||
import com.android.settingslib.preference.PreferenceScreenCreator;
|
||||
import com.android.settingslib.search.Indexable;
|
||||
|
||||
@@ -94,8 +92,6 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
private boolean mListeningToCategoryChange;
|
||||
private List<String> mSuppressInjectedTileKeys;
|
||||
|
||||
private @Nullable UserRestrictionBindingHelper mUserRestrictionBindingHelper;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
@@ -182,13 +178,6 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
// editing dialog is recreated (that would happen before onResume is called).
|
||||
updatePreferenceStates();
|
||||
}
|
||||
if (isCatalystEnabled()) {
|
||||
PreferenceScreenBindingHelper helper = getPreferenceScreenBindingHelper();
|
||||
if (helper != null) {
|
||||
mUserRestrictionBindingHelper = new UserRestrictionBindingHelper(requireContext(),
|
||||
helper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -299,15 +288,6 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mUserRestrictionBindingHelper != null) {
|
||||
mUserRestrictionBindingHelper.close();
|
||||
mUserRestrictionBindingHelper = null;
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected abstract int getPreferenceScreenResId();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user