Fixed issue with background user window consuming touch events

When adding a window for a background user, it is possible for
the window to consume touch events because it is in the
COMMIT_DRAW_PENDING state. We allow the background user window
to transition READY_TO_SHOW state, but hide the window.

Change is based on https://android-review.googlesource.com/#/c/158772
and also reverts commits 6ee618509a392adb183c2e70390cd9e2031ff0d8
and 588932a53e63c0a7ee281dea22559c129b40eb99

Bug: 22531717
Bug: 22207948
Bug: 18510914
https://code.google.com/p/android-developer-preview/issues/detail?id=2667

Change-Id: I68d2e532c2b1def0d7b22c9b60e48110cf3cd686
2 files changed