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

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

Add PackageManager features for differentiating camera2 devices

Also rename DNG capability to RAW.

Bug: 15415688
Change-Id: I1ea9f65b03c4fa06a5004f9d1d485935742001c8
parent ef7d656d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -8666,9 +8666,13 @@ package android.content.pm {
    field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
    field public static final java.lang.String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
    field public static final java.lang.String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = "android.hardware.camera.capability.manual_post_processing";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = "android.hardware.camera.capability.manual_sensor";
    field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_RAW = "android.hardware.camera.capability.raw";
    field public static final java.lang.String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external";
    field public static final java.lang.String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
    field public static final java.lang.String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";
    field public static final java.lang.String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full";
    field public static final java.lang.String FEATURE_CONSUMER_IR = "android.hardware.consumerir";
    field public static final java.lang.String FEATURE_DEVICE_ADMIN = "android.software.device_admin";
    field public static final java.lang.String FEATURE_FAKETOUCH = "android.hardware.faketouch";
@@ -12746,9 +12750,9 @@ package android.hardware.camera2 {
    field public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; // 0x2
    field public static final int NOISE_REDUCTION_MODE_OFF = 0; // 0x0
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0; // 0x0
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_DNG = 3; // 0x3
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
    field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3
    field public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0; // 0x0
    field public static final int SCALER_CROPPING_TYPE_FREEFORM = 1; // 0x1
    field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3; // 0x3
+39 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,45 @@ public abstract class PackageManager {
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
     * of the cameras on the device supports the
     * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware}
     * capability level.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
     * of the cameras on the device supports the
     * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor}
     * capability level.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR =
            "android.hardware.camera.capability.manual_sensor";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
     * of the cameras on the device supports the
     * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing}
     * capability level.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING =
            "android.hardware.camera.capability.manual_post_processing";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
     * of the cameras on the device supports the
     * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}
     * capability level.
     */
    @SdkConstant(SdkConstantType.FEATURE)
    public static final String FEATURE_CAMERA_CAPABILITY_RAW =
            "android.hardware.camera.capability.raw";

    /**
     * Feature for {@link #getSystemAvailableFeatures} and
     * {@link #hasSystemFeature}: The device is capable of communicating with
+4 −4
Original line number Diff line number Diff line
@@ -887,7 +887,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
     * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
     * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
     * @see #REQUEST_AVAILABLE_CAPABILITIES_DNG
     * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
     */
    public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
            new Key<int[]>("android.request.availableCapabilities", int[].class);
@@ -1068,17 +1068,17 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <tr>
     * <td align="left">RAW_OPAQUE</td>
     * <td align="left">RAW16</td>
     * <td align="left">DNG</td>
     * <td align="left">RAW</td>
     * </tr>
     * <tr>
     * <td align="left">RAW16</td>
     * <td align="left">YUV_420_888</td>
     * <td align="left">DNG</td>
     * <td align="left">RAW</td>
     * </tr>
     * <tr>
     * <td align="left">RAW16</td>
     * <td align="left">JPEG</td>
     * <td align="left">DNG</td>
     * <td align="left">RAW</td>
     * </tr>
     * </tbody>
     * </table>
+7 −5
Original line number Diff line number Diff line
@@ -387,8 +387,11 @@ public abstract class CameraMetadata<TKey> {
    public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;

    /**
     * <p>The camera device supports outputting RAW buffers that can be
     * saved offline into a DNG format.</p>
     * <p>The camera device supports outputting RAW buffers and
     * metadata for interpreting them.</p>
     * <p>Devices supporting the RAW capability allow both for
     * saving DNG files, and for direct application processing of
     * raw sensor images.</p>
     * <ul>
     * <li>RAW_SENSOR is supported as an output format.</li>
     * <li>The maximum available resolution for RAW_SENSOR streams
@@ -403,7 +406,7 @@ public abstract class CameraMetadata<TKey> {
     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
     */
    public static final int REQUEST_AVAILABLE_CAPABILITIES_DNG = 3;
    public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3;

    /**
     * <p>The camera device supports the Zero Shutter Lag use case.</p>
@@ -1186,8 +1189,7 @@ public abstract class CameraMetadata<TKey> {
     * image while recording video) use case.</p>
     * <p>The camera device should take the highest-quality image
     * possible (given the other settings) without disrupting the
     * frame rate of video recording.<br />
     * </p>
     * frame rate of video recording.  </p>
     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
     */
    public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;