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

Commit e9bda90b authored by Ats Jenk's avatar Ats Jenk
Browse files

Add null check before hiding ime

ImeSourceControl or the ImeStatsToken are nullable.
Add checks to guard against NPE.

Bug: 396884941
Test: manual
Flag: EXEMPT trivial bugfix
Change-Id: I70bd28cad5577625510b7cd27708575b119326d1
parent 41795133
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -227,7 +227,13 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
    /** Hides the IME for Bubbles when the device is locked. */
    /** Hides the IME for Bubbles when the device is locked. */
    public void hideImeForBubblesWhenLocked(int displayId) {
    public void hideImeForBubblesWhenLocked(int displayId) {
        PerDisplay pd = mImePerDisplay.get(displayId);
        PerDisplay pd = mImePerDisplay.get(displayId);
        pd.setImeInputTargetRequestedVisibility(false, pd.getImeSourceControl().getImeStatsToken());
        InsetsSourceControl imeSourceControl = pd.getImeSourceControl();
        if (imeSourceControl != null) {
            ImeTracker.Token imeStatsToken = imeSourceControl.getImeStatsToken();
            if (imeStatsToken != null) {
                pd.setImeInputTargetRequestedVisibility(false, imeStatsToken);
            }
        }
    }
    }


    /** An implementation of {@link IDisplayWindowInsetsController} for a given display id. */
    /** An implementation of {@link IDisplayWindowInsetsController} for a given display id. */