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

Commit 120ae3db authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Fix NPE when calling PasswordViewEntry.getWindowInsetsController().hide()

As PasswordViewEntry didn't always attached to KeyguardPasswordView,
check if the view is attached in case NPE happen when getting null
WindowInsetsController

Fix: 192644416
Test: manual test as issue steps
Test: 1) make a security lock
      2) unlocked to go to launcher
      3) turn off screen
      4) check the log and make sure no crash log.
Change-Id: I13897f05576150b2f5e867c43d20efb02e681cef
parent 0077afd8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -228,13 +228,17 @@ public class KeyguardPasswordViewController
                super.onPause();
            });
        }
        if (mPasswordEntry.isAttachedToWindow()) {
            mPasswordEntry.getWindowInsetsController().hide(WindowInsets.Type.ime());
        }
    }

    @Override
    public void onStartingToHide() {
        if (mPasswordEntry.isAttachedToWindow()) {
            mPasswordEntry.getWindowInsetsController().hide(WindowInsets.Type.ime());
        }
    }

    private void updateSwitchImeButton() {
        // If there's more than one IME, enable the IME switcher button