Merge "Make sure to cleanup views that couldn't be added" into tm-qpr-dev am: c01cce0313
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19138536 Change-Id: I7d52c9d73afd051076c6f4516272f7464fa88352 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -404,9 +404,10 @@ public final class WindowManagerGlobal {
|
|||||||
try {
|
try {
|
||||||
root.setView(view, wparams, panelParentView, userId);
|
root.setView(view, wparams, panelParentView, userId);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
final int viewIndex = findViewLocked(view, false);
|
||||||
// BadTokenException or InvalidDisplayException, clean up.
|
// BadTokenException or InvalidDisplayException, clean up.
|
||||||
if (index >= 0) {
|
if (viewIndex >= 0) {
|
||||||
removeViewLocked(index, true);
|
removeViewLocked(viewIndex, true);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user