Remove enum type Interpolation from displayconfig

Enums are not encouraged in the API.

Bug: 218682932
Change-Id: I3624a75abcd87e685c4b58af9cf10c54af4d8feb
This commit is contained in:
Long Ling
2022-02-10 11:04:36 -08:00
parent f43fc83ff8
commit 51b62b9cb5
3 changed files with 12 additions and 28 deletions

View File

@@ -42,7 +42,6 @@ import com.android.server.display.config.DisplayConfiguration;
import com.android.server.display.config.DisplayQuirks;
import com.android.server.display.config.HbmTiming;
import com.android.server.display.config.HighBrightnessMode;
import com.android.server.display.config.Interpolation;
import com.android.server.display.config.NitsMap;
import com.android.server.display.config.Point;
import com.android.server.display.config.RefreshRateRange;
@@ -1254,19 +1253,17 @@ public class DisplayDeviceConfig {
}
}
private int convertInterpolationType(Interpolation value) {
if (value == null) {
private int convertInterpolationType(String value) {
if (TextUtils.isEmpty(value)) {
return INTERPOLATION_DEFAULT;
}
switch (value) {
case _default:
return INTERPOLATION_DEFAULT;
case linear:
return INTERPOLATION_LINEAR;
default:
Slog.wtf(TAG, "Unexpected Interpolation Type: " + value);
return INTERPOLATION_DEFAULT;
if ("linear".equals(value)) {
return INTERPOLATION_LINEAR;
}
Slog.wtf(TAG, "Unexpected Interpolation Type: " + value);
return INTERPOLATION_DEFAULT;
}
private void loadAmbientHorizonFromDdc(DisplayConfiguration config) {

View File

@@ -170,14 +170,6 @@
</xs:restriction>
</xs:simpleType>
<!-- Maps to DisplayDeviceConfig.INTERPOLATION_* values. -->
<xs:simpleType name="interpolation">
<xs:restriction base="xs:string">
<xs:enumeration value="default"/>
<xs:enumeration value="linear"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="thermalThrottling">
<xs:complexType>
<xs:element type="brightnessThrottlingMap" name="brightnessThrottlingMap">
@@ -216,7 +208,8 @@
<xs:annotation name="final"/>
</xs:element>
</xs:sequence>
<xs:attribute name="interpolation" type="interpolation" use="optional"/>
<!-- valid value of interpolation if specified: linear -->
<xs:attribute name="interpolation" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="point">

View File

@@ -108,17 +108,11 @@ package com.android.server.display.config {
method public final void setTransitionPoint_all(@NonNull java.math.BigDecimal);
}
public enum Interpolation {
method public String getRawName();
enum_constant public static final com.android.server.display.config.Interpolation _default;
enum_constant public static final com.android.server.display.config.Interpolation linear;
}
public class NitsMap {
ctor public NitsMap();
method public com.android.server.display.config.Interpolation getInterpolation();
method public String getInterpolation();
method @NonNull public final java.util.List<com.android.server.display.config.Point> getPoint();
method public void setInterpolation(com.android.server.display.config.Interpolation);
method public void setInterpolation(String);
}
public class Point {