Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57616ff authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Camera: Deprecate various older createCaptureSession variants

Move all the documentation to the most flexible option, and deprecate
the older variants.

Test: m offline-sdk-docs, full build
Bug: 130304741
Change-Id: I9775e474657b87157ae49c22b2156f6cabe2088b
parent b4632bca
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -17050,13 +17050,13 @@ package android.hardware.camera2 {
    method public abstract void close();
    method public abstract void close();
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int, java.util.Set<java.lang.String>) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int, java.util.Set<java.lang.String>) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public void createCaptureSession(android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException;
    method public void createCaptureSession(android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createCaptureSessionByOutputConfigurations(java.util.List<android.hardware.camera2.params.OutputConfiguration>, android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createCaptureSessionByOutputConfigurations(java.util.List<android.hardware.camera2.params.OutputConfiguration>, android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createConstrainedHighSpeedCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createConstrainedHighSpeedCaptureSession(@NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(@NonNull android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createReprocessCaptureRequest(@NonNull android.hardware.camera2.TotalCaptureResult) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSession(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createReprocessableCaptureSession(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.view.Surface>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public int getCameraAudioRestriction() throws android.hardware.camera2.CameraAccessException;
    method public int getCameraAudioRestriction() throws android.hardware.camera2.CameraAccessException;
    method @NonNull public abstract String getId();
    method @NonNull public abstract String getId();
    method public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException;
    method public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException;
+1 −1
Original line number Original line Diff line number Diff line
@@ -2395,7 +2395,7 @@ package android.hardware.biometrics {
package android.hardware.camera2 {
package android.hardware.camera2 {
  public abstract class CameraDevice implements java.lang.AutoCloseable {
  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
    field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
    field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
    field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
+1 −1
Original line number Original line Diff line number Diff line
@@ -1018,7 +1018,7 @@ package android.graphics.drawable {
package android.hardware.camera2 {
package android.hardware.camera2 {


  public abstract class CameraDevice implements java.lang.AutoCloseable {
  public abstract class CameraDevice implements java.lang.AutoCloseable {
    method public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method @Deprecated public abstract void createCustomCaptureSession(android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, int, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED = 1; // 0x1
    field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
    field public static final int SESSION_OPERATION_MODE_NORMAL = 0; // 0x0
    field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
    field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
+8 −12
Original line number Original line Diff line number Diff line
@@ -25,9 +25,12 @@ import java.util.List;
 * A constrained high speed capture session for a {@link CameraDevice}, used for capturing high
 * A constrained high speed capture session for a {@link CameraDevice}, used for capturing high
 * speed images from the {@link CameraDevice} for high speed video recording use case.
 * speed images from the {@link CameraDevice} for high speed video recording use case.
 * <p>
 * <p>
 * A CameraHighSpeedCaptureSession is created by providing a set of target output surfaces to
 * A CameraConstrainedHighSpeedCaptureSession is created by providing a session configuration to
 * {@link CameraDevice#createConstrainedHighSpeedCaptureSession}, Once created, the session is
 * {@link CameraDevice#createCaptureSession(SessionConfiguration)} with a type of
 * active until a new session is created by the camera device, or the camera device is closed.
 * {@link android.hardware.camera2.params.SessionConfiguration#SESSION_HIGH_SPEED}. The
 * CameraCaptureSession returned from {@link CameraCaptureSession.StateCallback} can then be cast to
 * a CameraConstrainedHighSpeedCaptureSession. Once created, the session is active until a new
 * session is created by the camera device, or the camera device is closed.
 * </p>
 * </p>
 * <p>
 * <p>
 * An active high speed capture session is a specialized capture session that is only targeted at
 * An active high speed capture session is a specialized capture session that is only targeted at
@@ -37,8 +40,8 @@ import java.util.List;
 * accepts request lists created via {@link #createHighSpeedRequestList}, and the request list can
 * accepts request lists created via {@link #createHighSpeedRequestList}, and the request list can
 * only be submitted to this session via {@link CameraCaptureSession#captureBurst captureBurst}, or
 * only be submitted to this session via {@link CameraCaptureSession#captureBurst captureBurst}, or
 * {@link CameraCaptureSession#setRepeatingBurst setRepeatingBurst}. See
 * {@link CameraCaptureSession#setRepeatingBurst setRepeatingBurst}. See
 * {@link CameraDevice#createConstrainedHighSpeedCaptureSession} for more details of the
 * {@link CameraDevice#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)}
 * limitations.
 * for more details of the limitations.
 * </p>
 * </p>
 * <p>
 * <p>
 * Creating a session is an expensive operation and can take several hundred milliseconds, since it
 * Creating a session is an expensive operation and can take several hundred milliseconds, since it
@@ -50,13 +53,6 @@ import java.util.List;
 * completed, then the {@link CameraCaptureSession.StateCallback#onConfigureFailed} is called, and
 * completed, then the {@link CameraCaptureSession.StateCallback#onConfigureFailed} is called, and
 * the session will not become active.
 * the session will not become active.
 * </p>
 * </p>
 * <!--
 * <p>
 * Any capture requests (repeating or non-repeating) submitted before the session is ready will be
 * queued up and will begin capture once the session becomes ready. In case the session cannot be
 * configured and {@link CameraCaptureSession.StateCallback#onConfigureFailed onConfigureFailed} is
 * called, all queued capture requests are discarded.  </p>
 * -->
 * <p>
 * <p>
 * If a new session is created by the camera device, then the previous session is closed, and its
 * If a new session is created by the camera device, then the previous session is closed, and its
 * associated {@link CameraCaptureSession.StateCallback#onClosed onClosed} callback will be
 * associated {@link CameraCaptureSession.StateCallback#onClosed onClosed} callback will be
+259 −229

File changed.

Preview size limit exceeded, changes collapsed.

Loading