Added checks while unfreezing bounds

- Make sure we don't try to remove from an empty list
- No need to do anything if the relaunch count is already 0.

Bug: 29758829
Change-Id: I042c231269a2297bb4b2ddd78092827c6738d192
This commit is contained in:
Wale Ogunwale
2016-06-27 10:15:20 -07:00
parent 8fd75428b4
commit 37dbafce9b

View File

@@ -626,6 +626,9 @@ class AppWindowToken extends WindowToken {
}
void clearRelaunching() {
if (mPendingRelaunchCount == 0) {
return;
}
if (canFreezeBounds()) {
unfreezeBounds();
}
@@ -711,8 +714,12 @@ class AppWindowToken extends WindowToken {
* Unfreezes the previously frozen bounds. See {@link #freezeBounds}.
*/
private void unfreezeBounds() {
mFrozenBounds.remove();
mFrozenMergedConfig.remove();
if (!mFrozenBounds.isEmpty()) {
mFrozenBounds.remove();
}
if (!mFrozenMergedConfig.isEmpty()) {
mFrozenMergedConfig.remove();
}
for (int i = windows.size() - 1; i >= 0; i--) {
final WindowState win = windows.get(i);
if (!win.mHasSurface) {