Fix NPE on ActivityStack.removeTask when launched with invalid taskId

Prevents NPE in removeTask when use getDisplay directly.

Bug: 119023840
Test: atest WmTests:ActivityStackTests

Change-Id: I894f4b13e8a61c267f51af5331d8524a26cea009
This commit is contained in:
Jeff Chang
2018-12-26 20:24:47 +08:00
parent b09eed2309
commit a2ee83dbc6

View File

@@ -5438,7 +5438,7 @@ class ActivityStack extends ConfigurationContainer {
if (isAttached()) {
getDisplay().positionChildAtBottom(this);
}
if (!isActivityTypeHome() || getDisplay().isRemoved()) {
if (!isActivityTypeHome() || !isAttached()) {
remove();
}
}