From 611fecec08eb9efeb4393b986d590369df5c812f Mon Sep 17 00:00:00 2001
From: Eino-Ville Talvala
Date: Thu, 10 Jul 2014 17:29:38 -0700
Subject: [PATCH] Add PackageManager features for differentiating camera2
devices
Also rename DNG capability to RAW.
Bug: 15415688
Change-Id: I1ea9f65b03c4fa06a5004f9d1d485935742001c8
---
api/current.txt | 6 ++-
.../android/content/pm/PackageManager.java | 39 +++++++++++++++++++
.../camera2/CameraCharacteristics.java | 8 ++--
.../hardware/camera2/CameraMetadata.java | 12 +++---
4 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/api/current.txt b/api/current.txt
index 6da33657f5d27..1c453d4fe212c 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 37df29a230a70..ee7810db1c522 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -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
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 4976a48e1cdb4..ff861209080d4 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -887,7 +887,7 @@ public final class CameraCharacteristics extends CameraMetadata REQUEST_AVAILABLE_CAPABILITIES =
new Key("android.request.availableCapabilities", int[].class);
@@ -1068,17 +1068,17 @@ public final class CameraCharacteristics extends CameraMetadata
* | RAW_OPAQUE |
* RAW16 |
- * DNG |
+ * RAW |
*
*
* | RAW16 |
* YUV_420_888 |
- * DNG |
+ * RAW |
*
*
* | RAW16 |
* JPEG |
- * DNG |
+ * RAW |
*
*
*
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 36b108989b5bd..63130a7e919d0 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -387,8 +387,11 @@ public abstract class CameraMetadata {
public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;
/**
- * The camera device supports outputting RAW buffers that can be
- * saved offline into a DNG format.
+ * The camera device supports outputting RAW buffers and
+ * metadata for interpreting them.
+ * Devices supporting the RAW capability allow both for
+ * saving DNG files, and for direct application processing of
+ * raw sensor images.
*
* - RAW_SENSOR is supported as an output format.
* - The maximum available resolution for RAW_SENSOR streams
@@ -403,7 +406,7 @@ public abstract class CameraMetadata {
* @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;
/**
*
The camera device supports the Zero Shutter Lag use case.
@@ -1186,8 +1189,7 @@ public abstract class CameraMetadata {
* image while recording video) use case.
* The camera device should take the highest-quality image
* possible (given the other settings) without disrupting the
- * frame rate of video recording.
- *
+ * frame rate of video recording.
* @see CaptureRequest#CONTROL_CAPTURE_INTENT
*/
public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;