public class HardwarePropertiesManager
extends Object
| java.lang.Object | |
| android.os.HardwarePropertiesManager | |
HardwarePropertiesManager类提供访问设备硬件状态的机制:CPU,GPU和电池温度,每个内核的CPU使用率,风扇速度等。
常量(Constants) |
|
|---|---|
int |
DEVICE_TEMPERATURE_BATTERY 电池温度以摄氏度表示。 |
int |
DEVICE_TEMPERATURE_CPU CPU的温度,以摄氏度表示。 |
int |
DEVICE_TEMPERATURE_GPU GPU的温度,以摄氏度表示。 |
int |
DEVICE_TEMPERATURE_SKIN 设备皮肤温度,以摄氏度表示。 |
int |
TEMPERATURE_CURRENT 获取当前温度。 |
int |
TEMPERATURE_SHUTDOWN 获取关机温度阈值。 |
int |
TEMPERATURE_THROTTLING 获取节流温度阈值。 |
int |
TEMPERATURE_THROTTLING_BELOW_VR_MIN 获得节流温度阈值,高于此温度阈值将不会满足VR模式的最低时钟频率。 |
float |
UNDEFINED_TEMPERATURE 未定义的温度常数。 |
公共方法(Public methods) |
|
|---|---|
CpuUsageInfo[] |
getCpuUsages() 为每个核心返回一组CPU使用率信息。 |
float[] |
getDeviceTemperatures(int type, int source) 以摄氏度返回设备温度数组。 |
float[] |
getFanSpeeds() 以RPM为单位返回风扇速度数组。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
int DEVICE_TEMPERATURE_BATTERY
电池温度以摄氏度表示。
常量值:2(0x00000002)
int DEVICE_TEMPERATURE_CPU
CPU的温度,以摄氏度表示。
常量值:0(0x00000000)
int DEVICE_TEMPERATURE_GPU
GPU的温度,以摄氏度表示。
常数值:1(0x00000001)
int DEVICE_TEMPERATURE_SKIN
设备皮肤温度,以摄氏度表示。
常量值:3(0x00000003)
int TEMPERATURE_THROTTLING_BELOW_VR_MIN
获得节流温度阈值,高于此温度阈值将不会满足VR模式的最低时钟频率。
常量值:3(0x00000003)
CpuUsageInfo[] getCpuUsages ()
为每个核心返回一组CPU使用率信息。
| 返回(Returns) | |
|---|---|
CpuUsageInfo[] |
an array of CpuUsageInfo for each core. Return null for each unplugged core. Empty if CPU usage is not supported on this system. |
| 抛出异常(Throws) | |
|---|---|
SecurityException |
if something other than the profile or device owner, or the current VR service tries to retrieve information provided by this service. |
float[] getDeviceTemperatures (int type,
int source)
以摄氏度返回设备温度数组。
| 参数(Parameters) | |
|---|---|
type |
int: type of requested device temperature, one of DEVICE_TEMPERATURE_CPU, DEVICE_TEMPERATURE_GPU, DEVICE_TEMPERATURE_BATTERY or DEVICE_TEMPERATURE_SKIN. |
source |
int: source of requested device temperature, one of TEMPERATURE_CURRENT, TEMPERATURE_THROTTLING, TEMPERATURE_THROTTLING_BELOW_VR_MIN or TEMPERATURE_SHUTDOWN. |
| 返回(Returns) | |
|---|---|
float[] |
an array of requested float device temperatures. Temperature equals to UNDEFINED_TEMPERATURE if undefined. Empty if platform doesn't provide the queried temperature. |
| 抛出异常(Throws) | |
|---|---|
SecurityException |
if something other than the profile or device owner, or the current VR service tries to retrieve information provided by this service. |
float[] getFanSpeeds ()
以RPM为单位返回风扇速度数组。
| 返回(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. |
| 抛出异常(Throws) | |
|---|---|
SecurityException |
if something other than the profile or device owner, or the current VR service tries to retrieve information provided by this service. |