CombinationQuery

public final class CombinationQuery


A client for querying camera feature combination support using Google Play services.

Summary

Public methods

static final @NonNull CombinationQuery

Returns a CombinationQuery instance.

final @NonNull QueryResult
isSessionConfigurationSupported(
    @NonNull String cameraId,
    @NonNull SessionConfiguration sessionConfig
)

Returns whether the given camera session configuration is supported.

final @NonNull QueryResult

Returns whether the given group of OutputConfigurations and Session Parameters is supported.

Public methods

getCombinationQueryClient

public static final @NonNull CombinationQuery getCombinationQueryClient(@NonNull Context context)

Returns a CombinationQuery instance. The first call initializes connection to Google Play Services and loads a database in memory. Subsequent calls will return the same instance.

As this may do a Binder call and a disk read, the first call should be delegated to a background thread in performance-sensitive applications. Further calls are lightweight and safe to call from any thread.

Parameters
@NonNull Context context

the context to use for loading the module

isSessionConfigurationSupported

public final @NonNull QueryResult isSessionConfigurationSupported(
    @NonNull String cameraId,
    @NonNull SessionConfiguration sessionConfig
)

Returns whether the given camera session configuration is supported.

Parameters
@NonNull String cameraId

the camera ID to use for the query

@NonNull SessionConfiguration sessionConfig

the session configuration to query

Returns
@NonNull QueryResult

the query result. See QueryResult for more details.

Throws
android.os.RemoteException

if the connection to backing database fails.

isSessionConfigurationSupportedLegacy

public final @NonNull QueryResult isSessionConfigurationSupportedLegacy(
    @NonNull String cameraId,
    @NonNull List<@NonNull OutputConfiguration> outputConfigs,
    @NonNull Map<@NonNull CaptureRequest.Key<@NonNull ?>, @NonNull Object> sessionParams
)

Returns whether the given group of OutputConfigurations and Session Parameters is supported. This API must be called if and only if CombinationQuery.isSessionConfigurationSupported cannot be.

Parameters
@NonNull String cameraId

the camera ID to use for the query

@NonNull List<@NonNull OutputConfiguration> outputConfigs

list of OutputConfigurations to query

@NonNull Map<@NonNull CaptureRequest.Key<@NonNull ?>, @NonNull Object> sessionParams

a map of CaptureRequest.Key to their corresponding values; these are the values that would typically be passed to SessionConfiguration.setSessionParameters

Returns
@NonNull QueryResult

the query result. See QueryResult for more details.

Throws
android.os.RemoteException

if the connection to backing database fails.