From 725844d05f65c7dd935da21b4abe4615d6097ecb Mon Sep 17 00:00:00 2001 From: Polina Bondarenko Date: Fri, 26 Feb 2016 12:07:50 +0100 Subject: [PATCH] Removed IAE from HardwarePropertiesManager. If unknown temperature type is passed to getDeviceTemperatures, returns empty array. Bug: 27365463 Change-Id: I223b5e4e0642aee7b32e44fea84e8dc465b7e90b --- core/java/android/os/HardwarePropertiesManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/HardwarePropertiesManager.java b/core/java/android/os/HardwarePropertiesManager.java index c72a6481ebedb..f48306a6737bc 100644 --- a/core/java/android/os/HardwarePropertiesManager.java +++ b/core/java/android/os/HardwarePropertiesManager.java @@ -69,7 +69,6 @@ public class HardwarePropertiesManager { * @return an array of requested float device temperatures. * Empty if platform doesn't provide the queried temperature. * - * @throws IllegalArgumentException if an incorrect temperature type is queried. * @throws SecurityException if a non profile or device owner tries to call this method. */ public @NonNull float[] getDeviceTemperatures(@DeviceTemperatureType int type) { @@ -84,7 +83,8 @@ public class HardwarePropertiesManager { return new float[0]; } default: - throw new IllegalArgumentException(); + Log.w(TAG, "Unknown device temperature type."); + return new float[0]; } }