Camera2: implement Key.toString()
Implement toString() for CameraCharacteristics.Key,
CaptureResult.Key, and CaptureRequest.Key.
Bug: 22279124
Change-Id: Ib1076e3f6d7bcbffbb148a7a01f72133daccebb8
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 9dee045..e071409 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -127,6 +127,20 @@
}
/**
+ * Return this {@link Key} as a string representation.
+ *
+ * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
+ * the name of this key as returned by {@link #getName}.</p>
+ *
+ * @return string representation of {@link Key}
+ */
+ @NonNull
+ @Override
+ public String toString() {
+ return String.format("CaptureResult.Key(%s)", mKey.getName());
+ }
+
+ /**
* Visible for CameraMetadataNative implementation only; do not use.
*
* TODO: Make this private or remove it altogether.