Block adding toast windows to non-empty tokens.

When adding a window of TYPE_TOAST, if addToastWindowRequiresToken is enabled, prevent the addition if the provided WindowToken is not empty. This enforces the constraint that a WindowToken for toasts should only contain a single toast window.

Bug: 389950114
Flag: EXEMPT BUGFIX
Test: atest WindowManagerServiceTests
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:fd23e57220d587660cbe175d6b465cbc2aec222c
Merged-In: I9f693bb0a28a08d53ad162c1e305e17170185680
Change-Id: I9f693bb0a28a08d53ad162c1e305e17170185680
2 files changed