camera/camera-testing/src/main/java/androidx/camera/testing/SurfaceTextureProvider.java
/**
     * Creates a {@link Preview.SurfaceProvider} that is backed by a {@link SurfaceTexture} which
     * is suitable to be used in testing that doesn't actually show camera preview but just need
     * a surface for preview.
     *
     * <p> The {@link SurfaceTexture} will be released when it is no longer needed.
     *
     */
Creates a  Preview.SurfaceProvider that is backed by a  SurfaceTexture which
is suitable to be used in testing that doesn't actually show camera preview but just need
a surface for preview.

 The  SurfaceTexture will be released when it is no longer needed.
Creates a Preview . SurfaceProvider that is backed by a SurfaceTexture which is suitable to be used in testing that doesn ' t actually show camera preview but just need a surface for preview . The SurfaceTexture will be released when it is no longer needed .
@NonNull
    public static Preview.SurfaceProvider createSurfaceTextureProvider() {
        return createSurfaceTextureProvider(new SurfaceTextureCallback() {
            @Override
            public void onSurfaceTextureReady(@NonNull SurfaceTexture surfaceTexture,
                    @NonNull Size resolution) {
            }
            @Override
            public void onSafeToRelease(@NonNull SurfaceTexture surfaceTexture) {
                surfaceTexture.release();
            }
        });
    }
@ NonNull public static Preview . SurfaceProvider createSurfaceTextureProvider ( ) { return createSurfaceTextureProvider ( new SurfaceTextureCallback ( ) { @ Override public void onSurfaceTextureReady ( @ NonNull SurfaceTexture surfaceTexture , @ NonNull Size resolution ) { } @ Override public void onSafeToRelease ( @ NonNull SurfaceTexture surfaceTexture ) { surfaceTexture . release ( ) ; } } ) ; }
Creates a {@link Preview.SurfaceProvider} that is backed by a {@link SurfaceTexture} which
 is suitable to be used in testing that doesn't actually show camera preview but just need
 a surface for preview.
Creates a { @link Preview . SurfaceProvider } that is backed by a { @link SurfaceTexture } which is suitable to be used in testing that doesn ' t actually show camera preview but just need a surface for preview .
// no op