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

Commit 8e6028ef authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Also catch InvalidDisplayException in SoftInputWindow#show()

This is a follow up to my previous commit [1], which introduced a
state machine to handle inevitable runtime failures in a graceful
manner. Since then, we have started relying more on multi-display,
which sometimes ends up throwing

  WindowManager.InvalidDisplayException

instead of

  WindowManager.BadTokenException.

From IMEs' viewpoints, that they are equally unavoidable. Let's catch
both of them.

 [1]: I1f51ed29df6b22b003ca285698e06b8f3ee5106a
      13a9ffba

Fix: 295880764
Test: no end-to-end test as we have not figured out how to reproduce
      this issue locally.
Change-Id: I66ba7b465e901e9ec2b31dd0245420513381872d
parent ddc461be
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -176,7 +176,8 @@ final class SoftInputWindow extends Dialog {
                try {
                    super.show();
                    updateWindowState(WindowState.SHOWN_AT_LEAST_ONCE);
                } catch (WindowManager.BadTokenException e) {
                } catch (WindowManager.BadTokenException
                         | WindowManager.InvalidDisplayException e) {
                    // Just ignore this exception.  Since show() can be requested from other
                    // components such as the system and there could be multiple event queues before
                    // the request finally arrives here, the system may have already invalidated the