Catch a missed case when adding a toast

We allow a single toast window per UID. It is possible that
the UID had another toast window that is going away and this
CL adds a catch all check as there was a case missing.

Change-Id: I4c68e7212a05ce349e6e5b1cffe6e36d429aaca0
This commit is contained in:
Svetoslav Ganov
2016-10-18 13:29:27 -07:00
parent 4bd26bef66
commit 200adfbea8
2 changed files with 2 additions and 3 deletions

View File

@@ -1121,8 +1121,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
for (int i = 0; i < windowCount; i++) {
final WindowState window = mWindows.get(i);
if (window.mAttrs.type == TYPE_TOAST && window.mOwnerUid == uid
&& !window.mPermanentlyHidden && !window.mAnimatingExit
&& !window.mRemoveOnExit) {
&& !window.mPermanentlyHidden && !window.mWindowRemovalAllowed) {
return false;
}
}

View File

@@ -488,7 +488,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
* or some other higher level component said so (e.g. activity manager).
* TODO: We should either have different booleans for the removal reason or use a bit-field.
*/
private boolean mWindowRemovalAllowed;
boolean mWindowRemovalAllowed;
/**
* Temp for keeping track of windows that have been removed when