Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8ada531 authored by Kevin Lim's avatar Kevin Lim
Browse files

[Settings] Remove logic to restore highlight to 0th item in

SettingsActivity.

Bug: b/303787732
Flag: NONE
Test: Manual: http://recall/clips/9504ce89-ec62-4b32-b43e-0740300f872f
Change-Id: I47e55811637ff2d7fff996b19ad7af867a1307ba
parent 9623aaa4
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.launcher3.settings;

import static android.provider.Settings.Global.DEVELOPMENT_SETTINGS_ENABLED;

import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS;
import static androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT;

import static com.android.launcher3.BuildConfig.IS_DEBUG_DEVICE;
@@ -34,7 +33,6 @@ import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.view.WindowCompat;
@@ -290,8 +288,6 @@ public class SettingsActivity extends FragmentActivity
                if (highlighter != null) {
                    getView().postDelayed(highlighter, DELAY_HIGHLIGHT_DURATION_MILLIS);
                    mPreferenceHighlighted = true;
                } else {
                    requestAccessibilityFocus(getListView());
                }
            }

@@ -350,14 +346,5 @@ public class SettingsActivity extends FragmentActivity
                    list, position, screen.findPreference(mHighLightKey))
                    : null;
        }

        private void requestAccessibilityFocus(@NonNull final RecyclerView rv) {
            rv.post(() -> {
                if (!rv.hasFocus() && rv.getChildCount() > 0) {
                    rv.getChildAt(0)
                            .performAccessibilityAction(ACTION_ACCESSIBILITY_FOCUS, null);
                }
            });
        }
    }
}