Merge "Fix the problem that the "Turn off SIM" dialog will be displayed when the MobileNetwork page is slid to to top." into sc-dev am: d0adfa7b3e am: d9f6bf7461

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14964824

Change-Id: I5de5e4ec6ff5fdfe85c42fe54a047024d084795a
This commit is contained in:
Stanley Wang
2021-06-16 11:45:33 +00:00
committed by Automerger Merge Worker
2 changed files with 32 additions and 6 deletions

View File

@@ -82,15 +82,15 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements
holder.setDividerAllowedAbove(false);
holder.setDividerAllowedBelow(false);
mMainSwitchBar = (SettingsMainSwitchBar) holder.findViewById(R.id.main_switch_bar);
mMainSwitchBar.show();
if (mRestrictedHelper != null) {
mEnforcedAdmin = mRestrictedHelper.checkRestrictionEnforced();
}
updateStatus(isChecked());
registerListenerToSwitchBar();
if (!mIsVisible) {
mMainSwitchBar = (SettingsMainSwitchBar) holder.findViewById(R.id.main_switch_bar);
if (mIsVisible) {
mMainSwitchBar.show();
updateStatus(isChecked());
registerListenerToSwitchBar();
} else {
mMainSwitchBar.hide();
}
}