Improve the windows register and unregister mechanism

1. For fixing the crash due to mutl-register callback, we avoid using
the display context when un-registering the callback. Instead, we
remove the observer mapping if the display exists along with the
observer of any embedded displays that are children of the
un-registered one.

2. When an display registers its callback first, and then got its
reparent window, there's an displayWindowObserver for it in the
A11yWindowManager. But it didn't be used because it's an embedded
display and any windows change on it will be notified through the
callback of its parent display. So we add a callback to remove
this un-used displayWindowObservers in the A11yWindowManager when
this display is an embedded one.

Bug: 143114102
Test: a11y CTS & unit tests
Merged-In: I00fd1f45c0b4e362143a8d82f31264ff202f0967
Change-Id: I00fd1f45c0b4e362143a8d82f31264ff202f0967
(cherry picked from commit 5b8b737755b6f0d5fad0d4bf1f31254a9c71a5ab)
4 files changed