Some fixes for docking from navigation bar use case

- Do not set replace window if we are keeping the window.

- After we received the app's addWindow request, do a reset of the
timeout timer to give the app more time to finish drawing. This
reduces the chance of the flash due to the old window being removed
before new window is drawn.

- If we really hit timeout limit, make sure the replaced window
is removed by using removeWindowInnerLocked(), not removeWindowLocked().
The latter does not actually remove the window if it's exiting,
and this leaves the window in the stack and marked not for
for replacing, then it can never be removed.

bug: 26324082

Change-Id: I59594798079481cba9490c4754de1b16533e72fe
4 files changed