FakeDynamicRangeProfiles


public final class FakeDynamicRangeProfiles implements DynamicRangeProfilesWrapper


A fake implementation of DynamicRangeProfilesWrapper for testing.

This class allows setting mock values for supported profiles, capture request constraints, and extra latency profiles.

Summary

Public constructors

FakeDynamicRangeProfiles(
    @NonNull Set<@NonNull Long> supportedProfiles,
    @NonNull Map<@NonNull Long, @NonNull Set<@NonNull Long>> compatibleProfiles,
    @NonNull Set<@NonNull Long> extraLatencyProfiles
)

Public methods

@NonNull Set<@NonNull Long>
getCompatibleProfiles(long profile)

Returns a set of supported dynamic range profiles that can be referenced in a single capture request along with the given profile.

@NonNull Set<@NonNull Long>

Returns a set of supported dynamic range profiles.

boolean
hasExtraLatency(long profile)

Checks whether a given dynamic range profile incurs extra latency.

T
<T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

Attempts to unwrap this object into the specified underlying type.

Public constructors

FakeDynamicRangeProfiles

public FakeDynamicRangeProfiles(
    @NonNull Set<@NonNull Long> supportedProfiles,
    @NonNull Map<@NonNull Long, @NonNull Set<@NonNull Long>> compatibleProfiles,
    @NonNull Set<@NonNull Long> extraLatencyProfiles
)

Public methods

getCompatibleProfiles

Added in 1.7.0-alpha03
public @NonNull Set<@NonNull LonggetCompatibleProfiles(long profile)

Returns a set of supported dynamic range profiles that can be referenced in a single capture request along with the given profile.

A profile is always compatible with itself, and is included in the returned set.

Parameters
long profile

The dynamic range profile to query compatibility for.

Returns
@NonNull Set<@NonNull Long>

An unmodifiable set of supported dynamic range profiles.

getSupportedProfiles

Added in 1.7.0-alpha03
public @NonNull Set<@NonNull LonggetSupportedProfiles()

Returns a set of supported dynamic range profiles.

Returns
@NonNull Set<@NonNull Long>

An unmodifiable set of supported dynamic range profiles.

hasExtraLatency

Added in 1.7.0-alpha03
public boolean hasExtraLatency(long profile)

Checks whether a given dynamic range profile incurs extra latency.

Profiles that incur extra latency may not be suitable for latency-sensitive use cases, such as real-time previews.

Parameters
long profile

The dynamic range profile to check.

Returns
boolean

true if the profile incurs extra latency, false otherwise.

unwrapAs

Added in 1.7.0-alpha03
public T <T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

Attempts to unwrap this object into the specified underlying type.

Callers should use this method to retrieve the wrapped platform object.

Implementation Notes

  • If the requested type is not supported by this wrapper, this method must return null.

  • Implementations designed for testing (e.g., fakes, mocks, or no-op wrappers) should return null to signal that no real underlying object is available.

Parameters
<T extends Object>

The expected type of the underlying object.

@NonNull Class<@NonNull T> type

The Class representing the expected type of the underlying object.

Returns
T

The underlying object cast to T, or null if the object cannot be unwrapped into the requested type.