Remove Ink window when IME is switched.

In [1] we started removing InkWindow from WM when Stylus
handwriting is inactive. This is a followup that handles a
special case of IME switch. If IME is switched before we remove the
invisible InkWindow, WindowManager will continue to hold a reference
to an orphan ink window.

This CL explicitly removes any Ink window when switching away from
stylus handwriting capable IME.

[1]: I3b2e7c8271dd60b189d30a226a9483fb3c5cdcd9

Fix: 300546382
Test: atest StylusHandwritingTest and manually verify that there are
no orphan windows in "adb shell dumpsys window windows" after switching
from Stylus handwriting capable IME.

Change-Id: Id222485735dab286b0a28650462ea5c239cdcfdf
1 file changed