diff options
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | api/test-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/os/HardwarePropertiesManager.java | 13 | ||||
| -rw-r--r-- | services/core/jni/com_android_server_HardwarePropertiesManagerService.cpp | 10 |
5 files changed, 23 insertions, 3 deletions
diff --git a/api/current.txt b/api/current.txt index 26ce5367ab4a..e743881e63aa 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28707,6 +28707,7 @@ package android.os { field public static final int TEMPERATURE_CURRENT = 0; // 0x0 field public static final int TEMPERATURE_SHUTDOWN = 2; // 0x2 field public static final int TEMPERATURE_THROTTLING = 1; // 0x1 + field public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3; // 0x3 field public static final float UNDEFINED_TEMPERATURE = -3.4028235E38f; } diff --git a/api/system-current.txt b/api/system-current.txt index d4f566fa9484..008b8603afca 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -30951,6 +30951,7 @@ package android.os { field public static final int TEMPERATURE_CURRENT = 0; // 0x0 field public static final int TEMPERATURE_SHUTDOWN = 2; // 0x2 field public static final int TEMPERATURE_THROTTLING = 1; // 0x1 + field public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3; // 0x3 field public static final float UNDEFINED_TEMPERATURE = -3.4028235E38f; } diff --git a/api/test-current.txt b/api/test-current.txt index 994ad744a854..78a1d3af422a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -28772,6 +28772,7 @@ package android.os { field public static final int TEMPERATURE_CURRENT = 0; // 0x0 field public static final int TEMPERATURE_SHUTDOWN = 2; // 0x2 field public static final int TEMPERATURE_THROTTLING = 1; // 0x1 + field public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3; // 0x3 field public static final float UNDEFINED_TEMPERATURE = -3.4028235E38f; } diff --git a/core/java/android/os/HardwarePropertiesManager.java b/core/java/android/os/HardwarePropertiesManager.java index f13e5b57cbd0..9d362d61d9d4 100644 --- a/core/java/android/os/HardwarePropertiesManager.java +++ b/core/java/android/os/HardwarePropertiesManager.java @@ -48,7 +48,8 @@ public class HardwarePropertiesManager { */ @Retention(RetentionPolicy.SOURCE) @IntDef({ - TEMPERATURE_CURRENT, TEMPERATURE_THROTTLING, TEMPERATURE_SHUTDOWN + TEMPERATURE_CURRENT, TEMPERATURE_THROTTLING, TEMPERATURE_SHUTDOWN, + TEMPERATURE_THROTTLING_BELOW_VR_MIN }) public @interface TemperatureSource {} @@ -77,6 +78,12 @@ public class HardwarePropertiesManager { /** Get shutdown temperature threshold. */ public static final int TEMPERATURE_SHUTDOWN = 2; + /** + * Get throttling temperature threshold above which minimum clockrates for VR mode will not be + * met. + */ + public static final int TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3; + /** Undefined temperature constant. */ public static final float UNDEFINED_TEMPERATURE = -Float.MAX_VALUE; @@ -96,7 +103,8 @@ public class HardwarePropertiesManager { * {@link #DEVICE_TEMPERATURE_GPU}, {@link #DEVICE_TEMPERATURE_BATTERY} or {@link * #DEVICE_TEMPERATURE_SKIN}. * @param source source of requested device temperature, one of {@link #TEMPERATURE_CURRENT}, - * {@link #TEMPERATURE_THROTTLING} or {@link #TEMPERATURE_SHUTDOWN}. + * {@link #TEMPERATURE_THROTTLING}, {@link #TEMPERATURE_THROTTLING_BELOW_VR_MIN} or + * {@link #TEMPERATURE_SHUTDOWN}. * @return an array of requested float device temperatures. Temperature equals to * {@link #UNDEFINED_TEMPERATURE} if undefined. * Empty if platform doesn't provide the queried temperature. @@ -115,6 +123,7 @@ public class HardwarePropertiesManager { case TEMPERATURE_CURRENT: case TEMPERATURE_THROTTLING: case TEMPERATURE_SHUTDOWN: + case TEMPERATURE_THROTTLING_BELOW_VR_MIN: try { return mService.getDeviceTemperatures(mContext.getOpPackageName(), type, source); diff --git a/services/core/jni/com_android_server_HardwarePropertiesManagerService.cpp b/services/core/jni/com_android_server_HardwarePropertiesManagerService.cpp index ec5e8c921979..14d50ce957fe 100644 --- a/services/core/jni/com_android_server_HardwarePropertiesManagerService.cpp +++ b/services/core/jni/com_android_server_HardwarePropertiesManagerService.cpp @@ -36,7 +36,8 @@ namespace android { enum { TEMPERATURE_CURRENT = 0, TEMPERATURE_THROTTLING = 1, - TEMPERATURE_SHUTDOWN = 2 + TEMPERATURE_SHUTDOWN = 2, + TEMPERATURE_THROTTLING_BELOW_VR_MIN = 3 }; static struct { @@ -127,6 +128,13 @@ static jfloatArray nativeGetDeviceTemperatures(JNIEnv *env, jclass /* clazz */, values[length++] = list[i].shutdown_threshold; } break; + case TEMPERATURE_THROTTLING_BELOW_VR_MIN: + if (list[i].vr_throttling_threshold == UNKNOWN_TEMPERATURE) { + values[length++] = gUndefinedTemperature; + } else { + values[length++] = list[i].vr_throttling_threshold; + } + break; } } } |