summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-09-12 02:24:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-12 02:24:42 +0000
commit20d97e1ce20a4db23fb1b9799f29744878ecee22 (patch)
treeec07cb5d39e3645feda3a6995e7ee46a55f9a778 /services
parent68ab6cf0ea4dce600728a433323ab73a956ec900 (diff)
parent41a7b7911eb7f1253c9037e70a6ffca9c535898d (diff)
downloadframeworks_base-20d97e1ce20a4db23fb1b9799f29744878ecee22.zip
frameworks_base-20d97e1ce20a4db23fb1b9799f29744878ecee22.tar.gz
frameworks_base-20d97e1ce20a4db23fb1b9799f29744878ecee22.tar.bz2
Merge "Add null checks to WindowState.getStack() calls." into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wm/WindowAnimator.java10
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java6
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java5
3 files changed, 17 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index 05fc424..da5cfda 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -458,7 +458,10 @@ public class WindowAnimator {
}
final int color = winAnimator.mAnimation.getBackgroundColor();
if (color != 0) {
- win.getStack().setAnimationBackground(winAnimator, color);
+ final TaskStack stack = win.getStack();
+ if (stack != null) {
+ stack.setAnimationBackground(winAnimator, color);
+ }
}
}
mAnimating = true;
@@ -477,7 +480,10 @@ public class WindowAnimator {
final int color = appAnimator.animation.getBackgroundColor();
if (color != 0) {
- win.getStack().setAnimationBackground(winAnimator, color);
+ final TaskStack stack = win.getStack();
+ if (stack != null) {
+ stack.setAnimationBackground(winAnimator, color);
+ }
}
}
} // end forall windows
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index b7e56cb..9033f30 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -8556,7 +8556,8 @@ public class WindowManagerService extends IWindowManager.Stub
layerChanged = true;
anyLayerChanged = true;
}
- if (layerChanged && w.getStack().isDimming(winAnimator)) {
+ final TaskStack stack = w.getStack();
+ if (layerChanged && stack != null && stack.isDimming(winAnimator)) {
// Force an animation pass just to update the mDimLayer layer.
scheduleAnimationLocked();
}
@@ -9380,6 +9381,9 @@ public class WindowManagerService extends IWindowManager.Stub
&& !w.mExiting) {
final WindowStateAnimator winAnimator = w.mWinAnimator;
final TaskStack stack = w.getStack();
+ if (stack == null) {
+ return;
+ }
stack.setDimmingTag();
if (!stack.isDimming(winAnimator)) {
if (localLOGV) Slog.v(TAG, "Win " + w + " start dimming.");
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index dd611ce..da97876 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1368,7 +1368,10 @@ class WindowStateAnimator {
mAnimator.setPendingLayoutChanges(w.getDisplayId(),
WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER);
if ((w.mAttrs.flags & LayoutParams.FLAG_DIM_BEHIND) != 0) {
- w.getStack().startDimmingIfNeeded(this);
+ final TaskStack stack = w.getStack();
+ if (stack != null) {
+ stack.startDimmingIfNeeded(this);
+ }
}
} catch (RuntimeException e) {
// If something goes wrong with the surface (such