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

Commit c0b23b03 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the toggle button flicker problem when display" into sc-dev

parents bcc49f1f 9fa4bb8f
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -309,11 +309,6 @@ public class AppInfoDashboardFragment extends DashboardFragment
        return controllers;
    }

    @Override
    protected boolean isParalleledControllers() {
        return true;
    }

    void addToCallbackList(Callback callback) {
        if (callback != null) {
            mCallbacks.add(callback);
+0 −5
Original line number Diff line number Diff line
@@ -49,11 +49,6 @@ public class ConnectedDeviceDashboardFragment extends DashboardFragment {
        return TAG;
    }

    @Override
    protected boolean isParalleledControllers() {
        return true;
    }

    @Override
    public int getHelpResource() {
        return R.string.help_url_connected_devices;
+2 −7
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.FeatureFlagUtils;
import android.util.Log;

import androidx.annotation.CallSuper;
@@ -36,7 +35,6 @@ import androidx.preference.SwitchPreference;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerListHelper;
import com.android.settings.core.SettingsBaseActivity;
import com.android.settings.overlay.FeatureFactory;
@@ -360,11 +358,6 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
     * Update state of each preference managed by PreferenceController.
     */
    protected void updatePreferenceStates() {
        if (isParalleledControllers() && FeatureFlagUtils.isEnabled(getContext(),
                FeatureFlags.CONTROLLER_ENHANCEMENT)) {
            updatePreferenceStatesInParallel();
            return;
        }
        final PreferenceScreen screen = getPreferenceScreen();
        Collection<List<AbstractPreferenceController>> controllerLists =
                mPreferenceControllers.values();
@@ -396,6 +389,8 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
     * Use parallel method to update state of each preference managed by PreferenceController.
     */
    @VisibleForTesting
    // To use this parallel approach will cause the side effect of the UI flicker. Such as
    // the thumb sliding of the toggle button.
    void updatePreferenceStatesInParallel() {
        final PreferenceScreen screen = getPreferenceScreen();
        final Collection<List<AbstractPreferenceController>> controllerLists =
+0 −5
Original line number Diff line number Diff line
@@ -402,11 +402,6 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
        return mPreferenceControllers;
    }

    @Override
    protected boolean isParalleledControllers() {
        return true;
    }

    private void registerReceivers() {
        LocalBroadcastManager.getInstance(getContext())
                .registerReceiver(mEnableAdbReceiver, new IntentFilter(
+0 −5
Original line number Diff line number Diff line
@@ -95,11 +95,6 @@ public class NetworkDashboardFragment extends DashboardFragment implements
                this /* fragment */, this /* mobilePlanHost */);
    }

    @Override
    protected boolean isParalleledControllers() {
        return true;
    }

    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
            Lifecycle lifecycle, MetricsFeatureProvider metricsFeatureProvider, Fragment fragment,
            MobilePlanPreferenceHost mobilePlanHost) {
Loading