XrDevice
public final class XrDevice
Provides hardware capabilities of the device.
Summary
Public methods |
|
|---|---|
static final @NonNull XrDevice |
getCurrentDevice( |
final @NonNull Lifecycle |
Returns this XrDevice's |
final @NonNull DisplayBlendMode |
Returns the preferred display blend mode for this session. |
final boolean |
Returns the |
final boolean |
Returns the |
final boolean |
Returns the |
final boolean |
Returns the |
static final boolean |
isProjectedServiceAvailable(@NonNull Context context)Returns true if the Android XR Projected service is available on this device. |
final boolean |
Returns whether the |
Public methods
getCurrentDevice
public static final @NonNull XrDevice getCurrentDevice(
@NonNull Context context,
@NonNull CoroutineContext coroutineContext
)
Get the current XrDevice for the provided Context.
| Parameters | |
|---|---|
@NonNull Context context |
the |
@NonNull CoroutineContext coroutineContext |
the |
| Throws | |
|---|---|
IllegalArgumentException |
if the provided |
getLifecycle
public final @NonNull Lifecycle getLifecycle()
Returns this XrDevice's Lifecycle.
The value will be the Projected device's lifecycle if its Context was used when calling getCurrentDevice.
| Throws | |
|---|---|
IllegalStateException |
if there is no lifecycle associated with this XrDevice. |
getPreferredDisplayBlendMode
public final @NonNull DisplayBlendMode getPreferredDisplayBlendMode()
Returns the preferred display blend mode for this session.
| Returns | |
|---|---|
@NonNull DisplayBlendMode |
The |
isDepthEstimationModeSupported
public final boolean isDepthEstimationModeSupported(@NonNull DepthEstimationMode mode)
Returns the XrDevice's support for the given DepthEstimationMode.
| Returns | |
|---|---|
boolean |
whether the device supports the supplied |
isEyeTrackingModeSupported
public final boolean isEyeTrackingModeSupported(@NonNull EyeTrackingMode mode)
Returns the XrDevice's support for the given EyeTrackingMode.
| Returns | |
|---|---|
boolean |
whether the device supports the supplied |
isGeospatialModeSupported
public final boolean isGeospatialModeSupported(@NonNull GeospatialMode mode)
Returns the XrDevice's support for the given GeospatialMode.
| Returns | |
|---|---|
boolean |
whether the device supports the supplied |
isHandTrackingModeSupported
public final boolean isHandTrackingModeSupported(@NonNull HandTrackingMode mode)
Returns the XrDevice's support for the given HandTrackingMode.
| Returns | |
|---|---|
boolean |
whether the device supports the supplied |
isProjectedServiceAvailable
public static final boolean isProjectedServiceAvailable(@NonNull Context context)
Returns true if the Android XR Projected service is available on this device. This means the device supports the necessary system features and has the required system service components for Projected experiences. Returns false otherwise.
isRenderingModeSupported
public final boolean isRenderingModeSupported(@NonNull RenderingMode mode)
Returns whether the XrDevice supports the supplied RenderingMode.
| Returns | |
|---|---|
boolean |
whether the device supports the supplied |