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

Commit 64b66e60 authored by jeffreyhuang's avatar jeffreyhuang
Browse files

Optimize poking to happen in dashboard fragment

 - Make sure that poking happens only once in
 onDeveloperOptionsDisabled()

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: I2a47f34ab17bf57ac4dabc7b0e67b42cc0b120b7
parent ae6c29d1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.settings.widget.SwitchBar;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.development.DevelopmentSettingsEnabler;
import com.android.settingslib.development.SystemPropPoker;

import java.util.ArrayList;
import java.util.Arrays;
@@ -126,12 +127,16 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
                EnableDevelopmentSettingWarningDialog.show(this /* host */);
            } else {
                DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(getContext(), false);
                final SystemPropPoker poker = SystemPropPoker.getInstance();
                poker.blockPokes();
                for (AbstractPreferenceController controller : mPreferenceControllers) {
                    if (controller instanceof DeveloperOptionsPreferenceController) {
                        ((DeveloperOptionsPreferenceController) controller)
                                .onDeveloperOptionsDisabled();
                    }
                }
                poker.unblockPokes();
                poker.poke();
            }
        }
    }