Merge "Port autobrightness brightnening and darkening light debounce config from per device to per display configs" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
543223fd1c
@@ -33,6 +33,7 @@ import android.view.DisplayAddress;
|
|||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.display.BrightnessSynchronizer;
|
import com.android.internal.display.BrightnessSynchronizer;
|
||||||
|
import com.android.server.display.config.AutoBrightness;
|
||||||
import com.android.server.display.config.BrightnessThresholds;
|
import com.android.server.display.config.BrightnessThresholds;
|
||||||
import com.android.server.display.config.BrightnessThrottlingMap;
|
import com.android.server.display.config.BrightnessThrottlingMap;
|
||||||
import com.android.server.display.config.BrightnessThrottlingPoint;
|
import com.android.server.display.config.BrightnessThrottlingPoint;
|
||||||
@@ -69,9 +70,8 @@ import java.util.List;
|
|||||||
import javax.xml.datatype.DatatypeConfigurationException;
|
import javax.xml.datatype.DatatypeConfigurationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads and stores display-specific configurations.
|
* Reads and stores display-specific configurations. File format:
|
||||||
* File format:
|
* <pre>
|
||||||
* <pre>
|
|
||||||
* {@code
|
* {@code
|
||||||
* <displayConfiguration>
|
* <displayConfiguration>
|
||||||
* <densityMapping>
|
* <densityMapping>
|
||||||
@@ -147,6 +147,15 @@ import javax.xml.datatype.DatatypeConfigurationException;
|
|||||||
* <quirk>canSetBrightnessViaHwc</quirk>
|
* <quirk>canSetBrightnessViaHwc</quirk>
|
||||||
* </quirks>
|
* </quirks>
|
||||||
*
|
*
|
||||||
|
* <autoBrightness>
|
||||||
|
* <brighteningLightDebounceMillis>
|
||||||
|
* 2000
|
||||||
|
* </brighteningLightDebounceMillis>
|
||||||
|
* <darkeningLightDebounceMillis>
|
||||||
|
* 1000
|
||||||
|
* </darkeningLightDebounceMillis>
|
||||||
|
* </autoBrightness>
|
||||||
|
*
|
||||||
* <screenBrightnessRampFastDecrease>0.01</screenBrightnessRampFastDecrease>
|
* <screenBrightnessRampFastDecrease>0.01</screenBrightnessRampFastDecrease>
|
||||||
* <screenBrightnessRampFastIncrease>0.02</screenBrightnessRampFastIncrease>
|
* <screenBrightnessRampFastIncrease>0.02</screenBrightnessRampFastIncrease>
|
||||||
* <screenBrightnessRampSlowDecrease>0.03</screenBrightnessRampSlowDecrease>
|
* <screenBrightnessRampSlowDecrease>0.03</screenBrightnessRampSlowDecrease>
|
||||||
@@ -224,6 +233,9 @@ public class DisplayDeviceConfig {
|
|||||||
// Length of the ambient light horizon used to calculate short-term estimate of ambient light.
|
// Length of the ambient light horizon used to calculate short-term estimate of ambient light.
|
||||||
private static final int AMBIENT_LIGHT_SHORT_HORIZON_MILLIS = 2000;
|
private static final int AMBIENT_LIGHT_SHORT_HORIZON_MILLIS = 2000;
|
||||||
|
|
||||||
|
// Invalid value of AutoBrightness brightening and darkening light debounce
|
||||||
|
private static final int INVALID_AUTO_BRIGHTNESS_LIGHT_DEBOUNCE = -1;
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final float HDR_PERCENT_OF_SCREEN_REQUIRED_DEFAULT = 0.5f;
|
static final float HDR_PERCENT_OF_SCREEN_REQUIRED_DEFAULT = 0.5f;
|
||||||
|
|
||||||
@@ -281,6 +293,14 @@ public class DisplayDeviceConfig {
|
|||||||
private String mLoadedFrom = null;
|
private String mLoadedFrom = null;
|
||||||
private Spline mSdrToHdrRatioSpline;
|
private Spline mSdrToHdrRatioSpline;
|
||||||
|
|
||||||
|
// Represents the auto-brightness brightening light debounce.
|
||||||
|
private long mAutoBrightnessBrighteningLightDebounce =
|
||||||
|
INVALID_AUTO_BRIGHTNESS_LIGHT_DEBOUNCE;
|
||||||
|
|
||||||
|
// Represents the auto-brightness darkening light debounce.
|
||||||
|
private long mAutoBrightnessDarkeningLightDebounce =
|
||||||
|
INVALID_AUTO_BRIGHTNESS_LIGHT_DEBOUNCE;
|
||||||
|
|
||||||
// Brightness Throttling data may be updated via the DeviceConfig. Here we store the original
|
// Brightness Throttling data may be updated via the DeviceConfig. Here we store the original
|
||||||
// data, which comes from the ddc, and the current one, which may be the DeviceConfig
|
// data, which comes from the ddc, and the current one, which may be the DeviceConfig
|
||||||
// overwritten value.
|
// overwritten value.
|
||||||
@@ -293,8 +313,8 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance for the specified display.
|
* Creates an instance for the specified display. Tries to find a file with identifier in the
|
||||||
* Tries to find a file with identifier in the following priority order:
|
* following priority order:
|
||||||
* <ol>
|
* <ol>
|
||||||
* <li>physicalDisplayId</li>
|
* <li>physicalDisplayId</li>
|
||||||
* <li>physicalDisplayId without a stable flag (old system)</li>
|
* <li>physicalDisplayId without a stable flag (old system)</li>
|
||||||
@@ -314,11 +334,12 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance using global values since no display device config xml exists.
|
* Creates an instance using global values since no display device config xml exists. Uses
|
||||||
* Uses values from config or PowerManager.
|
* values from config or PowerManager.
|
||||||
*
|
*
|
||||||
* @param context
|
* @param context The context from which the DisplayDeviceConfig is to be constructed.
|
||||||
* @param useConfigXml
|
* @param useConfigXml A flag indicating if values are to be loaded from the configuration file,
|
||||||
|
* or the default values.
|
||||||
* @return A configuration instance.
|
* @return A configuration instance.
|
||||||
*/
|
*/
|
||||||
public static DisplayDeviceConfig create(Context context, boolean useConfigXml) {
|
public static DisplayDeviceConfig create(Context context, boolean useConfigXml) {
|
||||||
@@ -450,8 +471,8 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the backlight value, as recognised by the HAL, from the brightness value
|
* Calculates the backlight value, as recognised by the HAL, from the brightness value given
|
||||||
* given that the rest of the system deals with.
|
* that the rest of the system deals with.
|
||||||
*
|
*
|
||||||
* @param brightness value on the framework scale of 0-1
|
* @param brightness value on the framework scale of 0-1
|
||||||
* @return backlight value on the HAL scale of 0-1
|
* @return backlight value on the HAL scale of 0-1
|
||||||
@@ -502,13 +523,13 @@ public class DisplayDeviceConfig {
|
|||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Slog.d(TAG, "getHdrBrightnessFromSdr: sdr brightness " + brightness
|
Slog.d(TAG, "getHdrBrightnessFromSdr: sdr brightness " + brightness
|
||||||
+ " backlight " + backlight
|
+ " backlight " + backlight
|
||||||
+ " nits " + nits
|
+ " nits " + nits
|
||||||
+ " ratio " + ratio
|
+ " ratio " + ratio
|
||||||
+ " hdrNits " + hdrNits
|
+ " hdrNits " + hdrNits
|
||||||
+ " hdrBacklight " + hdrBacklight
|
+ " hdrBacklight " + hdrBacklight
|
||||||
+ " hdrBrightness " + hdrBrightness
|
+ " hdrBrightness " + hdrBrightness
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return hdrBrightness;
|
return hdrBrightness;
|
||||||
}
|
}
|
||||||
@@ -590,8 +611,8 @@ public class DisplayDeviceConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param quirkValue The quirk to test.
|
* @param quirkValue The quirk to test.
|
||||||
* @return {@code true} if the specified quirk is present in this configuration,
|
* @return {@code true} if the specified quirk is present in this configuration, {@code false}
|
||||||
* {@code false} otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean hasQuirk(String quirkValue) {
|
public boolean hasQuirk(String quirkValue) {
|
||||||
return mQuirks != null && mQuirks.contains(quirkValue);
|
return mQuirks != null && mQuirks.contains(quirkValue);
|
||||||
@@ -625,6 +646,20 @@ public class DisplayDeviceConfig {
|
|||||||
return BrightnessThrottlingData.create(mBrightnessThrottlingData);
|
return BrightnessThrottlingData.create(mBrightnessThrottlingData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Auto brightness darkening light debounce
|
||||||
|
*/
|
||||||
|
public long getAutoBrightnessDarkeningLightDebounce() {
|
||||||
|
return mAutoBrightnessDarkeningLightDebounce;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Auto brightness brightening light debounce
|
||||||
|
*/
|
||||||
|
public long getAutoBrightnessBrighteningLightDebounce() {
|
||||||
|
return mAutoBrightnessBrighteningLightDebounce;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DisplayDeviceConfig{"
|
return "DisplayDeviceConfig{"
|
||||||
@@ -663,6 +698,10 @@ public class DisplayDeviceConfig {
|
|||||||
+ ", mProximitySensor=" + mProximitySensor
|
+ ", mProximitySensor=" + mProximitySensor
|
||||||
+ ", mRefreshRateLimitations= " + Arrays.toString(mRefreshRateLimitations.toArray())
|
+ ", mRefreshRateLimitations= " + Arrays.toString(mRefreshRateLimitations.toArray())
|
||||||
+ ", mDensityMapping= " + mDensityMapping
|
+ ", mDensityMapping= " + mDensityMapping
|
||||||
|
+ ", mAutoBrightnessBrighteningLightDebounce= "
|
||||||
|
+ mAutoBrightnessBrighteningLightDebounce
|
||||||
|
+ ", mAutoBrightnessDarkeningLightDebounce= "
|
||||||
|
+ mAutoBrightnessDarkeningLightDebounce
|
||||||
+ "}";
|
+ "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,6 +758,7 @@ public class DisplayDeviceConfig {
|
|||||||
loadProxSensorFromDdc(config);
|
loadProxSensorFromDdc(config);
|
||||||
loadAmbientHorizonFromDdc(config);
|
loadAmbientHorizonFromDdc(config);
|
||||||
loadBrightnessChangeThresholds(config);
|
loadBrightnessChangeThresholds(config);
|
||||||
|
loadAutoBrightnessConfigValues(config);
|
||||||
} else {
|
} else {
|
||||||
Slog.w(TAG, "DisplayDeviceConfig file is null");
|
Slog.w(TAG, "DisplayDeviceConfig file is null");
|
||||||
}
|
}
|
||||||
@@ -899,8 +939,8 @@ public class DisplayDeviceConfig {
|
|||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
if (nits[i] < nits[i - 1]) {
|
if (nits[i] < nits[i - 1]) {
|
||||||
Slog.e(TAG, "sdrHdrRatioMap must be non-decreasing, ignoring rest "
|
Slog.e(TAG, "sdrHdrRatioMap must be non-decreasing, ignoring rest "
|
||||||
+ " of configuration. nits: " + nits[i] + " < "
|
+ " of configuration. nits: " + nits[i] + " < "
|
||||||
+ nits[i - 1]);
|
+ nits[i - 1]);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -927,7 +967,7 @@ public class DisplayDeviceConfig {
|
|||||||
final List<BrightnessThrottlingPoint> points = map.getBrightnessThrottlingPoint();
|
final List<BrightnessThrottlingPoint> points = map.getBrightnessThrottlingPoint();
|
||||||
// At least 1 point is guaranteed by the display device config schema
|
// At least 1 point is guaranteed by the display device config schema
|
||||||
List<BrightnessThrottlingData.ThrottlingLevel> throttlingLevels =
|
List<BrightnessThrottlingData.ThrottlingLevel> throttlingLevels =
|
||||||
new ArrayList<>(points.size());
|
new ArrayList<>(points.size());
|
||||||
|
|
||||||
boolean badConfig = false;
|
boolean badConfig = false;
|
||||||
for (BrightnessThrottlingPoint point : points) {
|
for (BrightnessThrottlingPoint point : points) {
|
||||||
@@ -938,7 +978,7 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
throttlingLevels.add(new BrightnessThrottlingData.ThrottlingLevel(
|
throttlingLevels.add(new BrightnessThrottlingData.ThrottlingLevel(
|
||||||
convertThermalStatus(status), point.getBrightness().floatValue()));
|
convertThermalStatus(status), point.getBrightness().floatValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!badConfig) {
|
if (!badConfig) {
|
||||||
@@ -947,6 +987,41 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadAutoBrightnessConfigValues(DisplayConfiguration config) {
|
||||||
|
loadAutoBrightnessBrighteningLightDebounce(config.getAutoBrightness());
|
||||||
|
loadAutoBrightnessDarkeningLightDebounce(config.getAutoBrightness());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the auto-brightness brightening light debounce. Internally, this takes care of loading
|
||||||
|
* the value from the display config, and if not present, falls back to config.xml.
|
||||||
|
*/
|
||||||
|
private void loadAutoBrightnessBrighteningLightDebounce(AutoBrightness autoBrightnessConfig) {
|
||||||
|
if (autoBrightnessConfig == null
|
||||||
|
|| autoBrightnessConfig.getBrighteningLightDebounceMillis() == null) {
|
||||||
|
mAutoBrightnessBrighteningLightDebounce = mContext.getResources().getInteger(
|
||||||
|
com.android.internal.R.integer.config_autoBrightnessBrighteningLightDebounce);
|
||||||
|
} else {
|
||||||
|
mAutoBrightnessBrighteningLightDebounce =
|
||||||
|
autoBrightnessConfig.getBrighteningLightDebounceMillis().intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads the auto-brightness darkening light debounce. Internally, this takes care of loading
|
||||||
|
* the value from the display config, and if not present, falls back to config.xml.
|
||||||
|
*/
|
||||||
|
private void loadAutoBrightnessDarkeningLightDebounce(AutoBrightness autoBrightnessConfig) {
|
||||||
|
if (autoBrightnessConfig == null
|
||||||
|
|| autoBrightnessConfig.getDarkeningLightDebounceMillis() == null) {
|
||||||
|
mAutoBrightnessDarkeningLightDebounce = mContext.getResources().getInteger(
|
||||||
|
com.android.internal.R.integer.config_autoBrightnessDarkeningLightDebounce);
|
||||||
|
} else {
|
||||||
|
mAutoBrightnessDarkeningLightDebounce =
|
||||||
|
autoBrightnessConfig.getDarkeningLightDebounceMillis().intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void loadBrightnessMapFromConfigXml() {
|
private void loadBrightnessMapFromConfigXml() {
|
||||||
// Use the config.xml mapping
|
// Use the config.xml mapping
|
||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
@@ -1058,17 +1133,17 @@ public class DisplayDeviceConfig {
|
|||||||
PowerManager.BRIGHTNESS_MIN, PowerManager.BRIGHTNESS_MAX, mBacklight[i]);
|
PowerManager.BRIGHTNESS_MIN, PowerManager.BRIGHTNESS_MAX, mBacklight[i]);
|
||||||
}
|
}
|
||||||
mBrightnessToBacklightSpline = mInterpolationType == INTERPOLATION_LINEAR
|
mBrightnessToBacklightSpline = mInterpolationType == INTERPOLATION_LINEAR
|
||||||
? Spline.createLinearSpline(mBrightness, mBacklight)
|
? Spline.createLinearSpline(mBrightness, mBacklight)
|
||||||
: Spline.createSpline(mBrightness, mBacklight);
|
: Spline.createSpline(mBrightness, mBacklight);
|
||||||
mBacklightToBrightnessSpline = mInterpolationType == INTERPOLATION_LINEAR
|
mBacklightToBrightnessSpline = mInterpolationType == INTERPOLATION_LINEAR
|
||||||
? Spline.createLinearSpline(mBacklight, mBrightness)
|
? Spline.createLinearSpline(mBacklight, mBrightness)
|
||||||
: Spline.createSpline(mBacklight, mBrightness);
|
: Spline.createSpline(mBacklight, mBrightness);
|
||||||
mBacklightToNitsSpline = mInterpolationType == INTERPOLATION_LINEAR
|
mBacklightToNitsSpline = mInterpolationType == INTERPOLATION_LINEAR
|
||||||
? Spline.createLinearSpline(mBacklight, mNits)
|
? Spline.createLinearSpline(mBacklight, mNits)
|
||||||
: Spline.createSpline(mBacklight, mNits);
|
: Spline.createSpline(mBacklight, mNits);
|
||||||
mNitsToBacklightSpline = mInterpolationType == INTERPOLATION_LINEAR
|
mNitsToBacklightSpline = mInterpolationType == INTERPOLATION_LINEAR
|
||||||
? Spline.createLinearSpline(mNits, mBacklight)
|
? Spline.createLinearSpline(mNits, mBacklight)
|
||||||
: Spline.createSpline(mNits, mBacklight);
|
: Spline.createSpline(mNits, mBacklight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadQuirks(DisplayConfiguration config) {
|
private void loadQuirks(DisplayConfiguration config) {
|
||||||
@@ -1111,7 +1186,7 @@ public class DisplayDeviceConfig {
|
|||||||
if (mHbmData.minimumHdrPercentOfScreen > 1
|
if (mHbmData.minimumHdrPercentOfScreen > 1
|
||||||
|| mHbmData.minimumHdrPercentOfScreen < 0) {
|
|| mHbmData.minimumHdrPercentOfScreen < 0) {
|
||||||
Slog.w(TAG, "Invalid minimum HDR percent of screen: "
|
Slog.w(TAG, "Invalid minimum HDR percent of screen: "
|
||||||
+ String.valueOf(mHbmData.minimumHdrPercentOfScreen));
|
+ String.valueOf(mHbmData.minimumHdrPercentOfScreen));
|
||||||
mHbmData.minimumHdrPercentOfScreen = HDR_PERCENT_OF_SCREEN_REQUIRED_DEFAULT;
|
mHbmData.minimumHdrPercentOfScreen = HDR_PERCENT_OF_SCREEN_REQUIRED_DEFAULT;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1235,7 +1310,7 @@ public class DisplayDeviceConfig {
|
|||||||
ambientBrightnessThresholds.getDarkeningThresholds();
|
ambientBrightnessThresholds.getDarkeningThresholds();
|
||||||
|
|
||||||
final BigDecimal ambientBrighteningThreshold = brighteningAmbientLux.getMinimum();
|
final BigDecimal ambientBrighteningThreshold = brighteningAmbientLux.getMinimum();
|
||||||
final BigDecimal ambientDarkeningThreshold = darkeningAmbientLux.getMinimum();
|
final BigDecimal ambientDarkeningThreshold = darkeningAmbientLux.getMinimum();
|
||||||
|
|
||||||
if (ambientBrighteningThreshold != null) {
|
if (ambientBrighteningThreshold != null) {
|
||||||
mAmbientLuxBrighteningMinThreshold = ambientBrighteningThreshold.floatValue();
|
mAmbientLuxBrighteningMinThreshold = ambientBrighteningThreshold.floatValue();
|
||||||
@@ -1330,8 +1405,8 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True if the sensor matches both the specified name and type, or one if only
|
* @return True if the sensor matches both the specified name and type, or one if only one
|
||||||
* one is specified (not-empty). Always returns false if both parameters are null or empty.
|
* is specified (not-empty). Always returns false if both parameters are null or empty.
|
||||||
*/
|
*/
|
||||||
public boolean matches(String sensorName, String sensorType) {
|
public boolean matches(String sensorName, String sensorType) {
|
||||||
final boolean isNameSpecified = !TextUtils.isEmpty(sensorName);
|
final boolean isNameSpecified = !TextUtils.isEmpty(sensorName);
|
||||||
@@ -1446,6 +1521,7 @@ public class DisplayDeviceConfig {
|
|||||||
return otherThrottlingLevel.thermalStatus == this.thermalStatus
|
return otherThrottlingLevel.thermalStatus == this.thermalStatus
|
||||||
&& otherThrottlingLevel.brightness == this.brightness;
|
&& otherThrottlingLevel.brightness == this.brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int result = 1;
|
int result = 1;
|
||||||
@@ -1455,8 +1531,11 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public BrightnessThrottlingData create(List<ThrottlingLevel> throttlingLevels)
|
|
||||||
{
|
/**
|
||||||
|
* Creates multiple teperature based throttling levels of brightness
|
||||||
|
*/
|
||||||
|
public static BrightnessThrottlingData create(List<ThrottlingLevel> throttlingLevels) {
|
||||||
if (throttlingLevels == null || throttlingLevels.size() == 0) {
|
if (throttlingLevels == null || throttlingLevels.size() == 0) {
|
||||||
Slog.e(TAG, "BrightnessThrottlingData received null or empty throttling levels");
|
Slog.e(TAG, "BrightnessThrottlingData received null or empty throttling levels");
|
||||||
return null;
|
return null;
|
||||||
@@ -1498,8 +1577,9 @@ public class DisplayDeviceConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static public BrightnessThrottlingData create(BrightnessThrottlingData other) {
|
static public BrightnessThrottlingData create(BrightnessThrottlingData other) {
|
||||||
if (other == null)
|
if (other == null) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return BrightnessThrottlingData.create(other.throttlingLevels);
|
return BrightnessThrottlingData.create(other.throttlingLevels);
|
||||||
}
|
}
|
||||||
@@ -1508,8 +1588,8 @@ public class DisplayDeviceConfig {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "BrightnessThrottlingData{"
|
return "BrightnessThrottlingData{"
|
||||||
+ "throttlingLevels:" + throttlingLevels
|
+ "throttlingLevels:" + throttlingLevels
|
||||||
+ "} ";
|
+ "} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -985,10 +985,10 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
|||||||
screenBrighteningThresholds, screenDarkeningThresholds, screenThresholdLevels,
|
screenBrighteningThresholds, screenDarkeningThresholds, screenThresholdLevels,
|
||||||
screenDarkeningMinThreshold, screenBrighteningMinThreshold);
|
screenDarkeningMinThreshold, screenBrighteningMinThreshold);
|
||||||
|
|
||||||
long brighteningLightDebounce = resources.getInteger(
|
long brighteningLightDebounce = mDisplayDeviceConfig
|
||||||
com.android.internal.R.integer.config_autoBrightnessBrighteningLightDebounce);
|
.getAutoBrightnessBrighteningLightDebounce();
|
||||||
long darkeningLightDebounce = resources.getInteger(
|
long darkeningLightDebounce = mDisplayDeviceConfig
|
||||||
com.android.internal.R.integer.config_autoBrightnessDarkeningLightDebounce);
|
.getAutoBrightnessDarkeningLightDebounce();
|
||||||
boolean autoBrightnessResetAmbientLuxAfterWarmUp = resources.getBoolean(
|
boolean autoBrightnessResetAmbientLuxAfterWarmUp = resources.getBoolean(
|
||||||
com.android.internal.R.bool.config_autoBrightnessResetAmbientLuxAfterWarmUp);
|
com.android.internal.R.bool.config_autoBrightnessResetAmbientLuxAfterWarmUp);
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
<xs:element type="highBrightnessMode" name="highBrightnessMode" minOccurs="0"
|
<xs:element type="highBrightnessMode" name="highBrightnessMode" minOccurs="0"
|
||||||
maxOccurs="1"/>
|
maxOccurs="1"/>
|
||||||
<xs:element type="displayQuirks" name="quirks" minOccurs="0" maxOccurs="1" />
|
<xs:element type="displayQuirks" name="quirks" minOccurs="0" maxOccurs="1" />
|
||||||
|
<xs:element type="autoBrightness" name="autoBrightness" minOccurs="0"
|
||||||
|
maxOccurs="1" />
|
||||||
<xs:element type="nonNegativeDecimal" name="screenBrightnessRampFastDecrease">
|
<xs:element type="nonNegativeDecimal" name="screenBrightnessRampFastDecrease">
|
||||||
<xs:annotation name="final"/>
|
<xs:annotation name="final"/>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
@@ -101,6 +103,21 @@
|
|||||||
|
|
||||||
<!-- Type definitions -->
|
<!-- Type definitions -->
|
||||||
|
|
||||||
|
<xs:complexType name="autoBrightness">
|
||||||
|
<xs:sequence>
|
||||||
|
<!-- Sets the debounce for autoBrightness brightening in millis-->
|
||||||
|
<xs:element name="brighteningLightDebounceMillis" type="xs:nonNegativeInteger"
|
||||||
|
minOccurs="0" maxOccurs="1">
|
||||||
|
<xs:annotation name="final"/>
|
||||||
|
</xs:element>
|
||||||
|
<!-- Sets the debounce for autoBrightness darkening in millis-->
|
||||||
|
<xs:element name="darkeningLightDebounceMillis" type="xs:nonNegativeInteger"
|
||||||
|
minOccurs="0" maxOccurs="1">
|
||||||
|
<xs:annotation name="final"/>
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
<xs:complexType name="displayQuirks">
|
<xs:complexType name="displayQuirks">
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element name="quirk" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
|
<xs:element name="quirk" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
|
||||||
@@ -341,5 +358,4 @@
|
|||||||
<xs:annotation name="final"/>
|
<xs:annotation name="final"/>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
// Signature format: 2.0
|
// Signature format: 2.0
|
||||||
package com.android.server.display.config {
|
package com.android.server.display.config {
|
||||||
|
|
||||||
|
public class AutoBrightness {
|
||||||
|
ctor public AutoBrightness();
|
||||||
|
method public final java.math.BigInteger getBrighteningLightDebounceMillis();
|
||||||
|
method public final java.math.BigInteger getDarkeningLightDebounceMillis();
|
||||||
|
method public final void setBrighteningLightDebounceMillis(java.math.BigInteger);
|
||||||
|
method public final void setDarkeningLightDebounceMillis(java.math.BigInteger);
|
||||||
|
}
|
||||||
|
|
||||||
public class BrightnessThresholds {
|
public class BrightnessThresholds {
|
||||||
ctor public BrightnessThresholds();
|
ctor public BrightnessThresholds();
|
||||||
method @NonNull public final java.math.BigDecimal getMinimum();
|
method @NonNull public final java.math.BigDecimal getMinimum();
|
||||||
@@ -40,6 +48,7 @@ package com.android.server.display.config {
|
|||||||
method @NonNull public final com.android.server.display.config.Thresholds getAmbientBrightnessChangeThresholds();
|
method @NonNull public final com.android.server.display.config.Thresholds getAmbientBrightnessChangeThresholds();
|
||||||
method public final java.math.BigInteger getAmbientLightHorizonLong();
|
method public final java.math.BigInteger getAmbientLightHorizonLong();
|
||||||
method public final java.math.BigInteger getAmbientLightHorizonShort();
|
method public final java.math.BigInteger getAmbientLightHorizonShort();
|
||||||
|
method public com.android.server.display.config.AutoBrightness getAutoBrightness();
|
||||||
method @Nullable public final com.android.server.display.config.DensityMapping getDensityMapping();
|
method @Nullable public final com.android.server.display.config.DensityMapping getDensityMapping();
|
||||||
method @NonNull public final com.android.server.display.config.Thresholds getDisplayBrightnessChangeThresholds();
|
method @NonNull public final com.android.server.display.config.Thresholds getDisplayBrightnessChangeThresholds();
|
||||||
method public com.android.server.display.config.HighBrightnessMode getHighBrightnessMode();
|
method public com.android.server.display.config.HighBrightnessMode getHighBrightnessMode();
|
||||||
@@ -58,6 +67,7 @@ package com.android.server.display.config {
|
|||||||
method public final void setAmbientBrightnessChangeThresholds(@NonNull com.android.server.display.config.Thresholds);
|
method public final void setAmbientBrightnessChangeThresholds(@NonNull com.android.server.display.config.Thresholds);
|
||||||
method public final void setAmbientLightHorizonLong(java.math.BigInteger);
|
method public final void setAmbientLightHorizonLong(java.math.BigInteger);
|
||||||
method public final void setAmbientLightHorizonShort(java.math.BigInteger);
|
method public final void setAmbientLightHorizonShort(java.math.BigInteger);
|
||||||
|
method public void setAutoBrightness(com.android.server.display.config.AutoBrightness);
|
||||||
method public final void setDensityMapping(@Nullable com.android.server.display.config.DensityMapping);
|
method public final void setDensityMapping(@Nullable com.android.server.display.config.DensityMapping);
|
||||||
method public final void setDisplayBrightnessChangeThresholds(@NonNull com.android.server.display.config.Thresholds);
|
method public final void setDisplayBrightnessChangeThresholds(@NonNull com.android.server.display.config.Thresholds);
|
||||||
method public void setHighBrightnessMode(com.android.server.display.config.HighBrightnessMode);
|
method public void setHighBrightnessMode(com.android.server.display.config.HighBrightnessMode);
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ public final class DisplayDeviceConfigTest {
|
|||||||
0.0f);
|
0.0f);
|
||||||
assertEquals(mDisplayDeviceConfig.getScreenBrighteningMinThreshold(), 0.001, 0.000001f);
|
assertEquals(mDisplayDeviceConfig.getScreenBrighteningMinThreshold(), 0.001, 0.000001f);
|
||||||
assertEquals(mDisplayDeviceConfig.getScreenDarkeningMinThreshold(), 0.002, 0.000001f);
|
assertEquals(mDisplayDeviceConfig.getScreenDarkeningMinThreshold(), 0.002, 0.000001f);
|
||||||
|
assertEquals(mDisplayDeviceConfig.getAutoBrightnessBrighteningLightDebounce(), 2000);
|
||||||
|
assertEquals(mDisplayDeviceConfig.getAutoBrightnessDarkeningLightDebounce(), 1000);
|
||||||
|
|
||||||
// Todo(brup): Add asserts for BrightnessThrottlingData, DensityMapping,
|
// Todo(brup): Add asserts for BrightnessThrottlingData, DensityMapping,
|
||||||
// HighBrightnessModeData AmbientLightSensor, RefreshRateLimitations and ProximitySensor.
|
// HighBrightnessModeData AmbientLightSensor, RefreshRateLimitations and ProximitySensor.
|
||||||
@@ -109,6 +111,10 @@ public final class DisplayDeviceConfigTest {
|
|||||||
+ "<nits>800.0</nits>\n"
|
+ "<nits>800.0</nits>\n"
|
||||||
+ "</point>\n"
|
+ "</point>\n"
|
||||||
+ "</screenBrightnessMap>\n"
|
+ "</screenBrightnessMap>\n"
|
||||||
|
+ "<autoBrightness>\n"
|
||||||
|
+ "<brighteningLightDebounceMillis>2000</brighteningLightDebounceMillis>\n"
|
||||||
|
+ "<darkeningLightDebounceMillis>1000</darkeningLightDebounceMillis>\n"
|
||||||
|
+ "</autoBrightness>\n"
|
||||||
+ "<highBrightnessMode enabled=\"true\">\n"
|
+ "<highBrightnessMode enabled=\"true\">\n"
|
||||||
+ "<transitionPoint>0.62</transitionPoint>\n"
|
+ "<transitionPoint>0.62</transitionPoint>\n"
|
||||||
+ "<minimumLux>10000</minimumLux>\n"
|
+ "<minimumLux>10000</minimumLux>\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user