# XRBatteryStateDisplayFeature

This [XRBatteryStateDisplayFeature](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#classGoogle_1_1XR_1_1Extensions_1_1XRBatteryStateDisplayFeature) provides a function to query the battery state of input devices.

## Summary

### Inheritance

Inherits from: `OpenXRFeature`

| ### Public attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#extensionstring = "XR_EXT_interaction_profile_battery_state_display"` | `const string` The OpenXR Extension string. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#featureid = "com.google.xr.extensions.battery_state_display"` | `const string` The feature ID string. |
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#uiname = "Battery State Display"` | `const string` The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes. |

| ### Public static attributes ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#isextensionenabled => _extensionEnabled` | `bool` Gets if the required OpenXR extension is enabled. |

| ### Public static functions ||
|---|---|
| `https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRBatteryStateDisplayFeature#trygetbatterystatedisplay(string topLevelUserPath, out BatteryStatus status, out float level)` | `bool` Gets the battery state for a given top level user input path. |

## Public attributes

### ExtensionString

```c#
const string ExtensionString = "XR_EXT_interaction_profile_battery_state_display"
```
The OpenXR Extension string.

Used to check if this extension is available or enabled.

### FeatureId

```c#
const string FeatureId = "com.google.xr.extensions.battery_state_display"
```
The feature ID string.

### UiName

```c#
const string UiName = "Battery State Display"
```
The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes.

## Public static attributes

### IsExtensionEnabled

```c#
bool IsExtensionEnabled => _extensionEnabled
```
Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns `null`. Otherwise, it indicates whether the XR_EXT_interaction_profile_battery_state_display extension is available on the current device.

## Public static functions

### TryGetBatteryStateDisplay

```c#
bool TryGetBatteryStateDisplay(
  string topLevelUserPath,
  out BatteryStatus status,
  out float level
)
```
Gets the battery state for a given top level user input path.


Details Parameters `topLevelUserPath` Top level user input path from OpenXRInteractionFeature.UserPaths. `batteryStatus` Battery state information.