Fix exception when trying to update config of detached stack

There is an NullPointerException which can be reproduced with following steps
on angler:
1. In split-screen open activities from the same app.
   Make sure to launch them from launcher.
2. Rotate device to landscape.
3. Force-stop the app using adb command.

After killing the app it will try to open launcher, which is fixed in
portrait mode on that device. This will update the configuration for all the
stacks, including already detached.

Bug: 28786255
Change-Id: Ia326c09cff9f1a3fb43cca5b48db29718553346a
This commit is contained in:
Andrii Kulian
2016-05-25 14:27:39 -07:00
parent 163236156f
commit 0be2cfec46

View File

@@ -380,6 +380,11 @@ public class TaskStack implements DimLayer.DimLayerUser,
}
private boolean updateBoundsAfterConfigChange() {
if (mDisplayContent == null) {
// If the stack is already detached we're not updating anything,
// as it's going away soon anyway.
return false;
}
final int newRotation = getDisplayInfo().rotation;
final int newDensity = getDisplayInfo().logicalDensityDpi;