OSDN Git Service

Fix issues with duplicate starting window add requests
authorJorim Jaggi <jjaggi@google.com>
Mon, 9 Apr 2018 22:34:24 +0000 (00:34 +0200)
committerJorim Jaggi <jjaggi@google.com>
Mon, 9 Apr 2018 22:34:24 +0000 (00:34 +0200)
commitd8665f2327ad9e0b2f723e21d1857893111fed9c
tree40546d472ddf7753d6893913169562d3365f1e94
parent782d10375c989f21a66d3c91ccce2c28b993711c
Fix issues with duplicate starting window add requests

There might be cases where we have multiple requests to add a
starting window. To protect against this, we
a) Check for existing startingWindow when adding starting window
b) Don't send the message if we already an add request pending
c) Remove any pending requests when we handle one request

There was already existing logic in place that checked whether
we have a starting window. However, that doesn't cover the case
when requests are pending, but the window hasn't been added yet.

Test: Open settings, open any sub-activity, go home, kill
settings, reopen settings. This generates a duplicate add request
almost guaranteed.
Test: go/wm-smoke
Fixes: 75030092

Change-Id: I5cb7fc0a4e7ab13dce3766be6afe1aa4f85df2e7
services/core/java/com/android/server/wm/AppWindowContainerController.java
services/core/java/com/android/server/wm/WindowManagerService.java