Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/os/HardwarePropertiesManager#constants) \| [Methods](https://developer.android.com/reference/android/os/HardwarePropertiesManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/os/HardwarePropertiesManager#inhmethods)

# HardwarePropertiesManager

*** ** * ** ***


`
public


class
HardwarePropertiesManager
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.HardwarePropertiesManager |

<br />

*** ** * ** ***

The HardwarePropertiesManager class provides a mechanism of accessing hardware state of a
device: CPU, GPU and battery temperatures, CPU usage per core, fan speed, etc.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_BATTERY` Temperature of battery in Celsius. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_CPU` Temperature of CPUs in Celsius. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_GPU` Temperature of GPUs in Celsius. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_SKIN` Temperature of device skin in Celsius. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_CURRENT` Get current temperature. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_SHUTDOWN` Get shutdown temperature threshold. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING` Get throttling temperature threshold. |
| `int` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING_BELOW_VR_MIN` Get throttling temperature threshold above which minimum clockrates for VR mode will not be met. |
| `float` | `https://developer.android.com/reference/android/os/HardwarePropertiesManager#UNDEFINED_TEMPERATURE` Undefined temperature constant. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/os/CpuUsageInfo` | ` https://developer.android.com/reference/android/os/HardwarePropertiesManager#getCpuUsages()() ` Return an array of CPU usage info for each core. |
| ` float[]` | ` https://developer.android.com/reference/android/os/HardwarePropertiesManager#getDeviceTemperatures(int,%20int)(int type, int source) ` Return an array of device temperatures in Celsius. |
| ` float[]` | ` https://developer.android.com/reference/android/os/HardwarePropertiesManager#getFanSpeeds()() ` Return an array of fan speeds in RPM. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### DEVICE_TEMPERATURE_BATTERY

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TEMPERATURE_BATTERY
```

Temperature of battery in Celsius.

<br />

Constant Value:

2
(0x00000002)


### DEVICE_TEMPERATURE_CPU

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TEMPERATURE_CPU
```

Temperature of CPUs in Celsius.

<br />

Constant Value:

0
(0x00000000)


### DEVICE_TEMPERATURE_GPU

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TEMPERATURE_GPU
```

Temperature of GPUs in Celsius.

<br />

Constant Value:

1
(0x00000001)


### DEVICE_TEMPERATURE_SKIN

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TEMPERATURE_SKIN
```

Temperature of device skin in Celsius.

<br />

Constant Value:

3
(0x00000003)


### TEMPERATURE_CURRENT

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TEMPERATURE_CURRENT
```

Get current temperature.

<br />

Constant Value:

0
(0x00000000)


### TEMPERATURE_SHUTDOWN

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TEMPERATURE_SHUTDOWN
```

Get shutdown temperature threshold.

<br />

Constant Value:

2
(0x00000002)


### TEMPERATURE_THROTTLING

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TEMPERATURE_THROTTLING
```

Get throttling temperature threshold.

<br />

Constant Value:

1
(0x00000001)


### TEMPERATURE_THROTTLING_BELOW_VR_MIN

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN
```

Get throttling temperature threshold above which minimum clockrates for VR mode will not be
met.

<br />

Constant Value:

3
(0x00000003)


### UNDEFINED_TEMPERATURE

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float UNDEFINED_TEMPERATURE
```

Undefined temperature constant.

<br />

Constant Value:

-3.4028235E38


## Public methods

### getCpuUsages

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CpuUsageInfo[] getCpuUsages ()
```

Return an array of CPU usage info for each core.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/CpuUsageInfo` | an array of `https://developer.android.com/reference/android/os/CpuUsageInfo` for each core. Return `null` for each unplugged core. Empty if CPU usage is not supported on this system. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if something other than the device owner or the current VR service tries to retrieve information provided by this service. |

### getDeviceTemperatures

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getDeviceTemperatures (int type, 
                int source)
```

Return an array of device temperatures in Celsius.

<br />

| Parameters ||
|---|---|
| `type` | `int`: type of requested device temperature, one of `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_CPU`, `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_GPU`, `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_BATTERY` or `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_SKIN`. Value is one of the following: - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_CPU` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_GPU` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_BATTERY` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#DEVICE_TEMPERATURE_SKIN` |
| `source` | `int`: source of requested device temperature, one of `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_CURRENT`, `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING`, `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING_BELOW_VR_MIN` or `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_SHUTDOWN`. Value is one of the following: - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_CURRENT` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_SHUTDOWN` - `https://developer.android.com/reference/android/os/HardwarePropertiesManager#TEMPERATURE_THROTTLING_BELOW_VR_MIN` |

| Returns ||
|---|---|
| `float[]` | an array of requested float device temperatures. Temperature equals to `https://developer.android.com/reference/android/os/HardwarePropertiesManager#UNDEFINED_TEMPERATURE` if undefined. Empty if platform doesn't provide the queried temperature. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if something other than the device owner or the current VR service tries to retrieve information provided by this service. |

### getFanSpeeds

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float[] getFanSpeeds ()
```

Return an array of fan speeds in RPM.

<br />

| Returns ||
|---|---|
| `float[]` | an array of float fan speeds in RPM. Empty if there are no fans or fan speed is not supported on this system. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if something other than the device owner or the current VR service tries to retrieve information provided by this service. |