Cancel wallpaper touch stream when foreground window is gone

When the foreground window is gone, we should also cancel the touch
stream for its wallpaper window. We already cancel touch for the window
itself, and for global monitor.

Without this patch, the wallpaper window simply stops receiving touches,
and never gets CANCEL, either.

The behaviour is slightly strange for the global monitor in this case.
First of all, the global monitor receives CANCEL, which is questionable
(things like pointer location stop working). Also, it only gets cancel
when a *new* event comes in.

That said, it's probably fine, so let's just document this behaviour by
adding a test for it.

Bug: 192981537
Test: atest inputflinger_tests
Change-Id: I8a2ef7cd552acc5cf64b2e13a6df5d5988bd1808
6 files changed