diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/TextureView.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java index 85b22fb..d70712a 100644 --- a/core/java/android/view/TextureView.java +++ b/core/java/android/view/TextureView.java @@ -717,6 +717,14 @@ public class TextureView extends View { if (surfaceTexture == null) { throw new NullPointerException("surfaceTexture must not be null"); } + if (surfaceTexture == mSurface) { + throw new IllegalArgumentException("Trying to setSurfaceTexture to " + + "the same SurfaceTexture that's already set."); + } + if (surfaceTexture.isReleased()) { + throw new IllegalArgumentException("Cannot setSurfaceTexture to a " + + "released SurfaceTexture"); + } if (mSurface != null) { mSurface.release(); } |
