From 44bc7d8c236b489a25cb8ce98ee5c7acd6da4d29 Mon Sep 17 00:00:00 2001
From: Jayant Chowdhary
Date: Tue, 10 Mar 2020 11:09:57 -0700
Subject: [PATCH] camera2: rename getConcurrentStreamingCameraIds() ->
getConcurrentCameraIds()
Bug: 150896133
Test: builds
Test: atest ConcurrentCameraTest.java
Change-Id: I0634358ed2591448d2f69be329a524fe1a197813
Signed-off-by: Jayant Chowdhary
---
api/current.txt | 2 +-
.../android/content/pm/PackageManager.java | 2 +-
.../camera2/CameraCharacteristics.java | 4 +--
.../hardware/camera2/CameraDevice.java | 2 +-
.../hardware/camera2/CameraManager.java | 26 +++++++++----------
.../params/MandatoryStreamCombination.java | 2 +-
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/api/current.txt b/api/current.txt
index 2ec3bcc271562..fb8a0e20b3750 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -17341,7 +17341,7 @@ package android.hardware.camera2 {
public final class CameraManager {
method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException;
method @NonNull public String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException;
- method @NonNull public java.util.Set> getConcurrentStreamingCameraIds() throws android.hardware.camera2.CameraAccessException;
+ method @NonNull public java.util.Set> getConcurrentCameraIds() throws android.hardware.camera2.CameraAccessException;
method @RequiresPermission(android.Manifest.permission.CAMERA) public boolean isConcurrentSessionConfigurationSupported(@NonNull java.util.Map) throws android.hardware.camera2.CameraAccessException;
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull android.hardware.camera2.CameraDevice.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException;
method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index fa751d3805808..439880a169264 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1978,7 +1978,7 @@ public abstract class PackageManager {
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device's main front and back cameras can stream
* concurrently as described in {@link
- * android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds()}
+ * android.hardware.camera2.CameraManager#getConcurrentCameraIds()}
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CAMERA_CONCURRENT = "android.hardware.camera.concurrent";
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index b3a1ee2f9b696..7e72b73db3584 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -2884,12 +2884,12 @@ public final class CameraCharacteristics extends CameraMetadata
+ * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds}.
* Optional - The value for this key may be {@code null} on some devices.
*/
@PublicKey
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index cc0c1a3090382..30ee32604939f 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -681,7 +681,7 @@ public abstract class CameraDevice implements AutoCloseable {
*
*
*Devices capable of streaming concurrently with other devices as described by
- * {@link android.hardware.camera2.CameraManager#getConcurrentStreamingCameraIds} have the
+ * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds} have the
* following guaranteed streams (when streaming concurrently with other devices)
*
*
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
index 85ef4a3392a8c..55f446a4d95cc 100644
--- a/core/java/android/hardware/camera2/CameraManager.java
+++ b/core/java/android/hardware/camera2/CameraManager.java
@@ -160,8 +160,8 @@ public final class CameraManager {
* @throws CameraAccessException if the camera device has been disconnected.
*/
@NonNull
- public Set> getConcurrentStreamingCameraIds() throws CameraAccessException {
- return CameraManagerGlobal.get().getConcurrentStreamingCameraIds();
+ public Set> getConcurrentCameraIds() throws CameraAccessException {
+ return CameraManagerGlobal.get().getConcurrentCameraIds();
}
/**
@@ -189,11 +189,11 @@ public final class CameraManager {
*
* @return {@code true} if the given combination of session configurations and corresponding
* camera ids are concurrently supported by the camera sub-system,
- * {@code false} otherwise.
+ * {@code false} otherwise OR if the set of camera devices provided is not a subset of
+ * those returned by {@link #getConcurrentCameraIds}.
*
- * @throws IllegalArgumentException if the set of camera devices provided is not a subset of
- * those returned by getConcurrentStreamingCameraIds()
* @throws CameraAccessException if one of the camera devices queried is no longer connected.
+ *
*/
@RequiresPermission(android.Manifest.permission.CAMERA)
public boolean isConcurrentSessionConfigurationSupported(
@@ -1156,7 +1156,7 @@ public final class CameraManager {
try {
ConcurrentCameraIdCombination[] cameraIdCombinations =
- cameraService.getConcurrentStreamingCameraIds();
+ cameraService.getConcurrentCameraIds();
for (ConcurrentCameraIdCombination comb : cameraIdCombinations) {
mConcurrentCameraIdCombinations.add(comb.getConcurrentCameraIdCombination());
}
@@ -1339,7 +1339,7 @@ public final class CameraManager {
return cameraIds;
}
- public @NonNull Set> getConcurrentStreamingCameraIds() {
+ public @NonNull Set> getConcurrentCameraIds() {
Set> concurrentStreamingCameraIds = null;
synchronized (mLock) {
// Try to make sure we have an up-to-date list of concurrent camera devices.
@@ -1365,7 +1365,7 @@ public final class CameraManager {
synchronized (mLock) {
// Go through all the elements and check if the camera ids are valid at least /
- // belong to one of the combinations returned by getConcurrentStreamingCameraIds()
+ // belong to one of the combinations returned by getConcurrentCameraIds()
boolean subsetFound = false;
for (Set combination : mConcurrentCameraIdCombinations) {
if (combination.containsAll(cameraIdsAndSessionConfigurations.keySet())) {
@@ -1373,9 +1373,9 @@ public final class CameraManager {
}
}
if (!subsetFound) {
- throw new IllegalArgumentException(
- "The set of camera ids provided is not a subset of"
- + "getConcurrentStreamingCameraIds");
+ Log.v(TAG, "isConcurrentSessionConfigurationSupported called with a subset of"
+ + "camera ids not returned by getConcurrentCameraIds");
+ return false;
}
CameraIdAndSessionConfiguration [] cameraIdsAndConfigs =
new CameraIdAndSessionConfiguration[size];
@@ -1403,10 +1403,10 @@ public final class CameraManager {
/**
* Helper function to find out if a camera id is in the set of combinations returned by
- * getConcurrentStreamingCameraIds()
+ * getConcurrentCameraIds()
* @param cameraId the unique identifier of the camera device to query
* @return Whether the camera device was found in the set of combinations returned by
- * getConcurrentStreamingCameraIds
+ * getConcurrentCameraIds
*/
public boolean cameraIdHasConcurrentStreamsLocked(String cameraId) {
if (!mDeviceStatus.containsKey(cameraId)) {
diff --git a/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java b/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java
index f0fab6a99d146..20d9c30bb4cce 100644
--- a/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java
+++ b/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java
@@ -721,7 +721,7 @@ public final class MandatoryStreamCombination {
/**
* Retrieve a list of all available mandatory concurrent stream combinations.
* This method should only be called for devices which are listed in combinations returned
- * by CameraManager.getConcurrentStreamingCameraIds.
+ * by CameraManager.getConcurrentCameraIds.
*
* @return a non-modifiable list of supported mandatory concurrent stream combinations.
*/