Use last focused window to control SysUI while IMC dialog is shown

This change fixes a bug that if a child window hides the system UI
but its parent activity window doesn't, the system UI may keep
showing and hiding infinitely.

Bug: b/111490047
Test: 1. atest WindowManagerSmokeTest
      2. atest CtsWindowManagerDeviceTestCases:LayoutTests
Change-Id: Id8bd6e80fe19051b97918089a05f2a12fc1a673d
4 files changed