summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-05-30 01:01:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-30 01:01:16 +0000
commit432fe9829744983576f0afabb4b73165f9695a8f (patch)
tree06832cc6c1016a9f948e0749366d124122f1e78f /core
parent3bd4feec3d5e5c2432a350b9ae4d7f2d8b8c69d8 (diff)
parent2dedafb48f85e34a2f48262f12908866fc9de132 (diff)
downloadframeworks_base-432fe9829744983576f0afabb4b73165f9695a8f.zip
frameworks_base-432fe9829744983576f0afabb4b73165f9695a8f.tar.gz
frameworks_base-432fe9829744983576f0afabb4b73165f9695a8f.tar.bz2
Merge "Fix NPE in onVisibilityChanged" into lmp-preview-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/TextureView.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index 1765c43..2a9f7d5 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -405,7 +405,9 @@ public class TextureView extends View {
// To cancel updates, the easiest thing to do is simply to remove the
// updates listener
if (visibility == VISIBLE) {
- mSurface.setOnFrameAvailableListener(mUpdateListener, mAttachInfo.mHandler);
+ if (mLayer != null) {
+ mSurface.setOnFrameAvailableListener(mUpdateListener, mAttachInfo.mHandler);
+ }
updateLayerAndInvalidate();
} else {
mSurface.setOnFrameAvailableListener(null);