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

Commit 023f2edd authored by Jag Saund's avatar Jag Saund Committed by Android (Google) Code Review
Browse files

Merge "Night Mode Indicator" into main

parents 8508c54d 16b3fdec
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19777,6 +19777,9 @@ package android.hardware.camera2 {
    field public static final int EDGE_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int EDGE_MODE_OFF = 0; // 0x0
    field public static final int EDGE_MODE_ZERO_SHUTTER_LAG = 3; // 0x3
    field @FlaggedApi("com.android.internal.camera.flags.night_mode_indicator") public static final int EXTENSION_NIGHT_MODE_INDICATOR_OFF = 1; // 0x1
    field @FlaggedApi("com.android.internal.camera.flags.night_mode_indicator") public static final int EXTENSION_NIGHT_MODE_INDICATOR_ON = 2; // 0x2
    field @FlaggedApi("com.android.internal.camera.flags.night_mode_indicator") public static final int EXTENSION_NIGHT_MODE_INDICATOR_UNKNOWN = 0; // 0x0
    field public static final int FLASH_MODE_OFF = 0; // 0x0
    field public static final int FLASH_MODE_SINGLE = 1; // 0x1
    field public static final int FLASH_MODE_TORCH = 2; // 0x2
@@ -20076,6 +20079,7 @@ package android.hardware.camera2 {
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> DISTORTION_CORRECTION_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EDGE_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EXTENSION_CURRENT_TYPE;
    field @FlaggedApi("com.android.internal.camera.flags.night_mode_indicator") @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EXTENSION_NIGHT_MODE_INDICATOR;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EXTENSION_STRENGTH;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_STATE;
+33 −0
Original line number Diff line number Diff line
@@ -4289,6 +4289,39 @@ public abstract class CameraMetadata<TKey> {
     */
    public static final int SYNC_FRAME_NUMBER_UNKNOWN = -2;

    //
    // Enumeration values for CaptureResult#EXTENSION_NIGHT_MODE_INDICATOR
    //

    /**
     * <p>The camera can't accurately assess the scene's lighting to determine if a Night Mode
     * Camera Extension capture would improve the photo. This can happen when the current
     * camera configuration doesn't support night mode indicator detection, such as when
     * the auto exposure mode is ON_AUTO_FLASH, ON_ALWAYS_FLASH, ON_AUTO_FLASH_REDEYE, or
     * ON_EXTERNAL_FLASH.</p>
     * @see CaptureResult#EXTENSION_NIGHT_MODE_INDICATOR
     */
    @FlaggedApi(Flags.FLAG_NIGHT_MODE_INDICATOR)
    public static final int EXTENSION_NIGHT_MODE_INDICATOR_UNKNOWN = 0;

    /**
     * <p>The camera has detected lighting conditions that are sufficiently bright. Night
     * Mode Camera Extensions is available but may not be able to optimize the camera
     * settings to take a higher quality photo.</p>
     * @see CaptureResult#EXTENSION_NIGHT_MODE_INDICATOR
     */
    @FlaggedApi(Flags.FLAG_NIGHT_MODE_INDICATOR)
    public static final int EXTENSION_NIGHT_MODE_INDICATOR_OFF = 1;

    /**
     * <p>The camera has detected low-light conditions. It is recommended to use Night Mode
     * Camera Extension to optimize the camera settings to take a high-quality photo in
     * the dark.</p>
     * @see CaptureResult#EXTENSION_NIGHT_MODE_INDICATOR
     */
    @FlaggedApi(Flags.FLAG_NIGHT_MODE_INDICATOR)
    public static final int EXTENSION_NIGHT_MODE_INDICATOR_ON = 2;

    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
     * End generated code
     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
+32 −0
Original line number Diff line number Diff line
@@ -6016,6 +6016,38 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
    public static final Key<Integer> EXTENSION_STRENGTH =
            new Key<Integer>("android.extension.strength", int.class);

    /**
     * <p>Indicates when to activate Night Mode Camera Extension for high-quality
     * still captures in low-light conditions.</p>
     * <p>Provides awareness to the application when the current scene can benefit from using a
     * Night Mode Camera Extension to take a high-quality photo.</p>
     * <p>Support for this capture result can be queried via
     * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
     * <p>If the device supports this capability then it will also support
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_NIGHT NIGHT}
     * and will be available in both
     * {@link android.hardware.camera2.CameraCaptureSession sessions} and
     * {@link android.hardware.camera2.CameraExtensionSession sessions}.</p>
     * <p>The value will be {@code UNKNOWN} in the following auto exposure modes: ON_AUTO_FLASH,
     * ON_ALWAYS_FLASH, ON_AUTO_FLASH_REDEYE, or ON_EXTERNAL_FLASH.</p>
     * <p><b>Possible values:</b></p>
     * <ul>
     *   <li>{@link #EXTENSION_NIGHT_MODE_INDICATOR_UNKNOWN UNKNOWN}</li>
     *   <li>{@link #EXTENSION_NIGHT_MODE_INDICATOR_OFF OFF}</li>
     *   <li>{@link #EXTENSION_NIGHT_MODE_INDICATOR_ON ON}</li>
     * </ul>
     *
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     * @see #EXTENSION_NIGHT_MODE_INDICATOR_UNKNOWN
     * @see #EXTENSION_NIGHT_MODE_INDICATOR_OFF
     * @see #EXTENSION_NIGHT_MODE_INDICATOR_ON
     */
    @PublicKey
    @NonNull
    @FlaggedApi(Flags.FLAG_NIGHT_MODE_INDICATOR)
    public static final Key<Integer> EXTENSION_NIGHT_MODE_INDICATOR =
            new Key<Integer>("android.extension.nightModeIndicator", int.class);

    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
     * End generated code
     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/