diff options
| author | John Reck <jreck@google.com> | 2015-05-14 23:27:47 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-14 23:27:49 +0000 |
| commit | 0e4a2b5ff0ee061c46bfe3b1f15a7067308e0da8 (patch) | |
| tree | 4ca4efbe64b2cc5224c37a687f3e6a361883302e /core/java/android | |
| parent | e650fd95a9d87f74fb420687b7062c9d428ef3f1 (diff) | |
| parent | 6d8371e73ff6452be5a23089e7edeb8d6d96f065 (diff) | |
| download | frameworks_base-0e4a2b5ff0ee061c46bfe3b1f15a7067308e0da8.zip frameworks_base-0e4a2b5ff0ee061c46bfe3b1f15a7067308e0da8.tar.gz frameworks_base-0e4a2b5ff0ee061c46bfe3b1f15a7067308e0da8.tar.bz2 | |
Merge "Check for setting to already set" into mnc-dev
Diffstat (limited to 'core/java/android')
| -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(); } |
