Settings: Set key order on addition

When the activity is created, injected preferences were not setting their order. This could potentially lead to two bottom preferences
in a given category on rebind. Ensure the order is set during key addition to prevent such issues.

Follow up to change: I1dc0148c5595f20daf026970d6514e63776b0499

Change-Id: I9df0bafbc2d2eddde94f07104d803fdc46adec8c
Signed-off-by: AnierinB <anierin@evolution-x.org>
This commit is contained in:
AnierinB 2025-01-27 20:36:56 +00:00 committed by Michael Bestas
parent ed77d8bd20
commit 7b76d2a842
No known key found for this signature in database

View file

@ -648,6 +648,10 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
observers = mDashboardFeatureProvider.bindPreferenceToTileAndGetObservers(
getActivity(), this, forceRoundedIcons, pref, tile, key,
mPlaceholderPreferenceController.getOrder());
// Order the prefs within their respective category
if (KEY_ORDER.containsKey(key)) {
pref.setOrder(KEY_ORDER.get(key));
}
if (Flags.dynamicInjectionCategory()) {
if (tile.hasGroupKey()) {
Preference group = screen.findPreference(tile.getGroupKey());