Merge "Camera: Annotate the Key constructors with nullability."
diff --git a/api/current.txt b/api/current.txt
index 92f5129..c79bec01b 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -16745,7 +16745,7 @@
}
public static final class CameraCharacteristics.Key<T> {
- ctor public CameraCharacteristics.Key(String, Class<T>);
+ ctor public CameraCharacteristics.Key(@NonNull String, @NonNull Class<T>);
method @NonNull public String getName();
}
@@ -17119,7 +17119,7 @@
}
public static final class CaptureRequest.Key<T> {
- ctor public CaptureRequest.Key(String, Class<T>);
+ ctor public CaptureRequest.Key(@NonNull String, @NonNull Class<T>);
method @NonNull public String getName();
}
@@ -17214,7 +17214,7 @@
}
public static final class CaptureResult.Key<T> {
- ctor public CaptureResult.Key(String, Class<T>);
+ ctor public CaptureResult.Key(@NonNull String, @NonNull Class<T>);
method @NonNull public String getName();
}
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 9da8e4e..f8b2a5b 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -98,7 +98,7 @@
* they may be useful for testing purposes and for defining custom camera
* characteristics.</p>
*/
- public Key(String name, Class<T> type) {
+ public Key(@NonNull String name, @NonNull Class<T> type) {
mKey = new CameraMetadataNative.Key<T>(name, type);
}
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index da1bfe4..eddfd7d 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -120,7 +120,7 @@
* {@link CaptureRequest}, and not need to construct their own Key objects. However, they
* may be useful for testing purposes and for defining custom capture request fields.</p>
*/
- public Key(String name, Class<T> type) {
+ public Key(@NonNull String name, @NonNull Class<T> type) {
mKey = new CameraMetadataNative.Key<T>(name, type);
}
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index bb0987d..7382ac4 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -101,7 +101,7 @@
* {@link CaptureResult}, and not need to construct their own Key objects. However, they may
* be useful for testing purposes and for defining custom capture result fields.</p>
*/
- public Key(String name, Class<T> type) {
+ public Key(@NonNull String name, @NonNull Class<T> type) {
mKey = new CameraMetadataNative.Key<T>(name, type);
}