XrDevice
class XrDevice
Provides hardware capabilities of the device.
Summary
Public companion functions |
|
|---|---|
XrDevice |
getCurrentDevice(context: Context, coroutineContext: CoroutineContext) |
Boolean |
isProjectedServiceAvailable(context: Context)Returns true if the Android XR Projected service is available on this device. |
Public functions |
|
|---|---|
Lifecycle |
Returns this XrDevice's |
DisplayBlendMode |
Returns the preferred display blend mode for this session. |
Boolean |
Returns the |
Boolean |
Returns the |
Boolean |
Returns the |
Boolean |
Returns the |
Boolean |
Returns whether the |
Public companion functions
getCurrentDevice
fun getCurrentDevice(
context: Context,
coroutineContext: CoroutineContext = EmptyCoroutineContext
): XrDevice
Get the current XrDevice for the provided Context.
| Parameters | |
|---|---|
context: Context |
the |
coroutineContext: CoroutineContext = EmptyCoroutineContext |
the |
| Throws | |
|---|---|
IllegalArgumentException |
if the provided |
isProjectedServiceAvailable
fun isProjectedServiceAvailable(context: Context): Boolean
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.
Public functions
getLifecycle
fun getLifecycle(): Lifecycle
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
fun getPreferredDisplayBlendMode(): DisplayBlendMode
Returns the preferred display blend mode for this session.
| Returns | |
|---|---|
DisplayBlendMode |
The |
isDepthEstimationModeSupported
fun isDepthEstimationModeSupported(mode: DepthEstimationMode): Boolean
Returns the XrDevice's support for the given DepthEstimationMode.
| Returns | |
|---|---|
Boolean |
whether the device supports the supplied |
isEyeTrackingModeSupported
fun isEyeTrackingModeSupported(mode: EyeTrackingMode): Boolean
Returns the XrDevice's support for the given EyeTrackingMode.
| Returns | |
|---|---|
Boolean |
whether the device supports the supplied |
isGeospatialModeSupported
fun isGeospatialModeSupported(mode: GeospatialMode): Boolean
Returns the XrDevice's support for the given GeospatialMode.
| Returns | |
|---|---|
Boolean |
whether the device supports the supplied |
isHandTrackingModeSupported
fun isHandTrackingModeSupported(mode: HandTrackingMode): Boolean
Returns the XrDevice's support for the given HandTrackingMode.
| Returns | |
|---|---|
Boolean |
whether the device supports the supplied |
isRenderingModeSupported
fun isRenderingModeSupported(mode: RenderingMode): Boolean
Returns whether the XrDevice supports the supplied RenderingMode.
| Returns | |
|---|---|
Boolean |
whether the device supports the supplied |