Loading core/java/android/os/HardwarePropertiesManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -109,8 +109,8 @@ public class HardwarePropertiesManager { * {@link #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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull float[] getDeviceTemperatures(@DeviceTemperatureType int type, @TemperatureSource int source) { Loading Loading @@ -147,8 +147,8 @@ public class HardwarePropertiesManager { * 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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull CpuUsageInfo[] getCpuUsages() { try { Loading @@ -164,8 +164,8 @@ public class HardwarePropertiesManager { * @return 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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull float[] getFanSpeeds() { try { Loading services/core/java/com/android/server/HardwarePropertiesManagerService.java +6 −6 Original line number Diff line number Diff line Loading @@ -82,9 +82,9 @@ public class HardwarePropertiesManagerService extends IHardwarePropertiesManager * * @param callingPackage The calling package name. * * @throws SecurityException if something other than the profile or device owner, the * current VR service, or a caller holding the {@link Manifest.permission#DEVICE_POWER} * permission tries to retrieve information provided by this service. * @throws SecurityException if something other than the device owner, the current VR service, * or a caller holding the {@link Manifest.permission#DEVICE_POWER} permission tries to * retrieve information provided by this service. */ private void enforceHardwarePropertiesRetrievalAllowed(String callingPackage) throws SecurityException { Loading @@ -102,12 +102,12 @@ public class HardwarePropertiesManagerService extends IHardwarePropertiesManager final int userId = UserHandle.getUserId(uid); final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class); final DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); if (!dpm.isDeviceOwnerApp(callingPackage) && !dpm.isProfileOwnerApp(callingPackage) if (!dpm.isDeviceOwnerApp(callingPackage) && !vrService.isCurrentVrListener(callingPackage, userId) && mContext.checkCallingOrSelfPermission(Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("The caller is not a device or profile owner, bound " + "VrListenerService, or holding the DEVICE_POWER permission."); throw new SecurityException("The caller is not a device owner, bound VrListenerService" + ", or holding the DEVICE_POWER permission."); } } } Loading
core/java/android/os/HardwarePropertiesManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -109,8 +109,8 @@ public class HardwarePropertiesManager { * {@link #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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull float[] getDeviceTemperatures(@DeviceTemperatureType int type, @TemperatureSource int source) { Loading Loading @@ -147,8 +147,8 @@ public class HardwarePropertiesManager { * 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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull CpuUsageInfo[] getCpuUsages() { try { Loading @@ -164,8 +164,8 @@ public class HardwarePropertiesManager { * @return 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. * @throws SecurityException if something other than the device owner or the current VR service * tries to retrieve information provided by this service. */ public @NonNull float[] getFanSpeeds() { try { Loading
services/core/java/com/android/server/HardwarePropertiesManagerService.java +6 −6 Original line number Diff line number Diff line Loading @@ -82,9 +82,9 @@ public class HardwarePropertiesManagerService extends IHardwarePropertiesManager * * @param callingPackage The calling package name. * * @throws SecurityException if something other than the profile or device owner, the * current VR service, or a caller holding the {@link Manifest.permission#DEVICE_POWER} * permission tries to retrieve information provided by this service. * @throws SecurityException if something other than the device owner, the current VR service, * or a caller holding the {@link Manifest.permission#DEVICE_POWER} permission tries to * retrieve information provided by this service. */ private void enforceHardwarePropertiesRetrievalAllowed(String callingPackage) throws SecurityException { Loading @@ -102,12 +102,12 @@ public class HardwarePropertiesManagerService extends IHardwarePropertiesManager final int userId = UserHandle.getUserId(uid); final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class); final DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); if (!dpm.isDeviceOwnerApp(callingPackage) && !dpm.isProfileOwnerApp(callingPackage) if (!dpm.isDeviceOwnerApp(callingPackage) && !vrService.isCurrentVrListener(callingPackage, userId) && mContext.checkCallingOrSelfPermission(Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("The caller is not a device or profile owner, bound " + "VrListenerService, or holding the DEVICE_POWER permission."); throw new SecurityException("The caller is not a device owner, bound VrListenerService" + ", or holding the DEVICE_POWER permission."); } } }