From b69896ae6070d4d8eb340842b513885217a2443f Mon Sep 17 00:00:00 2001 From: Stanley Wang Date: Wed, 3 Mar 2021 20:18:05 +0800 Subject: [PATCH] Fix that when scrolling to the top on Wi-Fi page, the "Turn off SIM" notification will pop up. The root cause of the problem is that the switch preference and switch bar status are not sync when using setCheckedInternal API. Fix: 179498532 Test: Run robotest and see the ui Change-Id: Ib51dc2ef27ce49b9c8ba69eb32757bf6b9945baf --- .../android/settings/widget/SettingsMainSwitchPreference.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/settings/widget/SettingsMainSwitchPreference.java b/src/com/android/settings/widget/SettingsMainSwitchPreference.java index 76f9b41d807..80a0021e44e 100644 --- a/src/com/android/settings/widget/SettingsMainSwitchPreference.java +++ b/src/com/android/settings/widget/SettingsMainSwitchPreference.java @@ -176,6 +176,7 @@ public class SettingsMainSwitchPreference extends TwoStatePreference { * Update the status of switch but doesn't notify the mOnBeforeListener. */ public void setCheckedInternal(boolean checked) { + super.setChecked(checked); if (mMainSwitchBar != null) { mMainSwitchBar.setCheckedInternal(checked); }