Fix NPE in overridePlayingAppAnimations
It's not guaranteed that findMainWindow() is non-null, which can happen if the window was just added, so we should not crash in that case. Change-Id: I1f04876ef48bfc7636320124b7f60d6dfa0b24a2 Fixes: 31767124
This commit is contained in:
@@ -846,6 +846,9 @@ class AppWindowToken extends WindowToken {
|
|||||||
void overridePlayingAppAnimations(Animation a) {
|
void overridePlayingAppAnimations(Animation a) {
|
||||||
if (mAppAnimator.isAnimating()) {
|
if (mAppAnimator.isAnimating()) {
|
||||||
final WindowState win = findMainWindow();
|
final WindowState win = findMainWindow();
|
||||||
|
if (win == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int width = win.mContainingFrame.width();
|
final int width = win.mContainingFrame.width();
|
||||||
final int height = win.mContainingFrame.height();
|
final int height = win.mContainingFrame.height();
|
||||||
mAppAnimator.setAnimation(a, width, height, false, STACK_CLIP_NONE);
|
mAppAnimator.setAnimation(a, width, height, false, STACK_CLIP_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user