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

Commit 4fecadeb authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Migrate to TwoStatePreference" into main

parents 44da7e6e 5748b9b8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.settingslib.core.instrumentation
import android.view.View
import androidx.annotation.VisibleForTesting
import androidx.preference.PreferenceGroupAdapter
import androidx.preference.SwitchPreference
import androidx.preference.TwoStatePreference
import androidx.recyclerview.widget.RecyclerView
import com.android.internal.jank.InteractionJankMonitor
import java.util.concurrent.Executors
@@ -43,7 +43,10 @@ object SettingsJankMonitor {
     * @param preference the clicked preference
     */
    @JvmStatic
    fun detectSwitchPreferenceClickJank(recyclerView: RecyclerView, preference: SwitchPreference) {
    fun detectSwitchPreferenceClickJank(
        recyclerView: RecyclerView,
        preference: TwoStatePreference,
    ) {
        val adapter = recyclerView.adapter as? PreferenceGroupAdapter ?: return
        val adapterPosition = adapter.getPreferenceAdapterPosition(preference)
        val viewHolder = recyclerView.findViewHolderForAdapterPosition(adapterPosition) ?: return