Fix tapping magnification crash in vision settings setup screen

Root cause: ag/17286343 introduces hiding the settings entry in magnification settings if window magnification feature is not supported. It causes SuW page cannot find the settings preference reference.
Solution: Add null pointer check.

Bug: 242242266
Test: Manual testing
Change-Id: I1007a580047dd302228b28c15b82e958a2b01fec
(cherry picked from commit 5a87f6bbbf)
This commit is contained in:
menghanli
2022-08-24 19:35:38 +08:00
committed by Menghan Li
parent 1218065085
commit 66a96d220e

View File

@@ -52,12 +52,18 @@ public class ToggleScreenMagnificationPreferenceFragmentForSetupWizard
*/ */
private void hidePreferenceSettingComponents() { private void hidePreferenceSettingComponents() {
// Intro // Intro
if (mTopIntroPreference != null) {
mTopIntroPreference.setVisible(false); mTopIntroPreference.setVisible(false);
}
// Setting of magnification type // Setting of magnification type
if (mSettingsPreference != null) {
mSettingsPreference.setVisible(false); mSettingsPreference.setVisible(false);
}
// Setting of following typing // Setting of following typing
if (mFollowingTypingSwitchPreference != null) {
mFollowingTypingSwitchPreference.setVisible(false); mFollowingTypingSwitchPreference.setVisible(false);
} }
}
@Override @Override
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent, public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent,