diff options
author | John Reck <jreck@google.com> | 2015-05-14 15:47:03 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-05-14 16:06:12 -0700 |
commit | 6d8371e73ff6452be5a23089e7edeb8d6d96f065 (patch) | |
tree | 7dad88f89ada8fcc80966eb2004753f2e94d6bfd /core/jni | |
parent | 6e1c17a3dfd62f3ae2a16ac64b8575fc3aa4a7a2 (diff) | |
download | frameworks_base-6d8371e73ff6452be5a23089e7edeb8d6d96f065.zip frameworks_base-6d8371e73ff6452be5a23089e7edeb8d6d96f065.tar.gz frameworks_base-6d8371e73ff6452be5a23089e7edeb8d6d96f065.tar.bz2 |
Check for setting to already set
Bug: 20105644
Change-Id: Ia79d2ae5c725c139d2b7c423a899be625cb8f14f
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android/graphics/SurfaceTexture.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index 35d69fe..08d61d5 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -341,6 +341,12 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz) surfaceTexture->abandon(); } +static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz) +{ + sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); + return surfaceTexture->isAbandoned(); +} + // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { @@ -355,6 +361,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, + {"nativeIsReleased", "()Z", (void*)SurfaceTexture_isReleased }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) |