Merge "Include VR throttling limit in hardware properties." into nyc-dev

This commit is contained in:
Ruben Brunk
2016-03-31 18:03:34 +00:00
committed by Android (Google) Code Review
5 changed files with 23 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;
}
}
}