camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/workaround/ForceCloseDeferrableSurface.java
/**
     * Close the {@link DeferrableSurface} to force the {@link DeferrableSurface} to be recreated
     * in the new CameraCaptureSession.
     */
Close the  DeferrableSurface to force the  DeferrableSurface to be recreated
in the new CameraCaptureSession.
Close the DeferrableSurface to force the DeferrableSurface to be recreated in the new CameraCaptureSession .
public void onSessionEnd(@Nullable List<DeferrableSurface> deferrableSurfaces) {
        if (shouldForceClose() && deferrableSurfaces != null) {
            for (DeferrableSurface deferrableSurface : deferrableSurfaces) {
                deferrableSurface.close();
            }
            Logger.d("ForceCloseDeferrableSurface", "deferrableSurface closed");
        }
    }
public void onSessionEnd ( @ Nullable List < DeferrableSurface > deferrableSurfaces ) { if ( shouldForceClose ( ) && deferrableSurfaces != null ) { for ( DeferrableSurface deferrableSurface : deferrableSurfaces ) { deferrableSurface . close ( ) ; } Logger . d ( "ForceCloseDeferrableSurface" , "deferrableSurface closed" ) ; } }
Close the {@link DeferrableSurface} to force the {@link DeferrableSurface} to be recreated
 in the new CameraCaptureSession.
Close the { @link DeferrableSurface } to force the { @link DeferrableSurface } to be recreated in the new CameraCaptureSession .