【发布时间】:2022-12-19 14:17:33
【问题描述】:
现在我想跑
HardwarePropertiesManager hardwarePropertiesManager = getApplicationContext().getSystemService(HardwarePropertiesManager.class);
hardwarePropertiesManager.getDeviceTemperatures(HardwarePropertiesManager.DEVICE_TEMPERATURE_CPU, HardwarePropertiesManager.TEMPERATURE_CURRENT);
检查CPU使用率和温度..
但是,发生了异常,即
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.___/com.example.___.MainActivity}:
java.lang.SecurityException: The caller is neither a device
owner, nor holding the DEVICE_POWER permission, nor the current
VrListener.
有什么方法可以检查 cpu 温度和 cpu 使用情况(内存,内核)??
【问题讨论】:
标签: java android android-11 android-api-30