Make SurfaceTexture#isReleased public API

Bug: 36902442
Test: bit CtsUiRenderingTestCases:android.uirendering.cts.testclasses.TextureViewTests

This method is already tested in TextureViewTests in CtsUiRenderingTestCases.

Change-Id: Id2d186f966d5e2b7c50a8b2ecefcd66c8a87c1fd
diff --git a/api/current.txt b/api/current.txt
index 7a01e1a..7bd1d51 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -13759,6 +13759,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
diff --git a/api/system-current.txt b/api/system-current.txt
index 6c5931e..a55013f 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -14534,6 +14534,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
diff --git a/api/test-current.txt b/api/test-current.txt
index c00795d..d4f4b03 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -13801,6 +13801,7 @@
     method public void detachFromGLContext();
     method public long getTimestamp();
     method public void getTransformMatrix(float[]);
+    method public boolean isReleased();
     method public void release();
     method public void releaseTexImage();
     method public void setDefaultBufferSize(int, int);
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 24fb673..97edf22 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -16,14 +16,14 @@
 
 package android.graphics;
 
-import java.lang.ref.WeakReference;
-
 import android.annotation.Nullable;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
 import android.view.Surface;
 
+import java.lang.ref.WeakReference;
+
 /**
  * Captures frames from an image stream as an OpenGL ES texture.
  *
@@ -345,14 +345,17 @@
      * Always call this method when you are done with SurfaceTexture. Failing
      * to do so may delay resource deallocation for a significant amount of
      * time.
+     *
+     * @see #isReleased()
      */
     public void release() {
         nativeRelease();
     }
 
     /**
-     * Returns true if the SurfaceTexture was released
-     * @hide
+     * Returns true if the SurfaceTexture was released.
+     *
+     * @see #release()
      */
     public boolean isReleased() {
         return nativeIsReleased();
@@ -400,7 +403,6 @@
     private native void nativeReleaseTexImage();
     private native int nativeDetachFromGLContext();
     private native int nativeAttachToGLContext(int texName);
-    private native int nativeGetQueuedCount();
     private native void nativeRelease();
     private native boolean nativeIsReleased();
 }