Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 499f5c8b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[CEC Configuration] Use 'int-value' field instead of 'hex-value'"

parents c5285573 fcfdd08b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -283,9 +283,7 @@ public class HdmiCecConfig {
    }

    private int getIntValue(@NonNull Value value) {
        return value.getHexValue() != null
               ? Integer.decode(value.getHexValue())
               : value.getIntValue();
        return Integer.decode(value.getIntValue());
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
  </xs:complexType>
  <xs:complexType name="value">
    <xs:attribute name="string-value" type="xs:string"/>
    <xs:attribute name="int-value" type="xs:int"/>
    <xs:attribute name="hex-value" type="xs:string"/>
    <xs:attribute name="int-value" type="xs:string"/>
  </xs:complexType>
</xs:schema>
+2 −4
Original line number Diff line number Diff line
@@ -22,11 +22,9 @@ package com.android.server.hdmi.cec.config {

  public class Value {
    ctor public Value();
    method public String getHexValue();
    method public int getIntValue();
    method public String getIntValue();
    method public String getStringValue();
    method public void setHexValue(String);
    method public void setIntValue(int);
    method public void setIntValue(String);
    method public void setStringValue(String);
  }

+12 −12
Original line number Diff line number Diff line
@@ -410,10 +410,10 @@ public final class HdmiCecConfigTest {
                + "           value-type=\"int\""
                + "           user-configurable=\"true\">"
                + "    <allowed-values>"
                + "      <value hex-value=\"0x00\" />"
                + "      <value hex-value=\"0x01\" />"
                + "      <value int-value=\"0x00\" />"
                + "      <value int-value=\"0x01\" />"
                + "    </allowed-values>"
                + "    <default-value hex-value=\"0x01\" />"
                + "    <default-value int-value=\"0x01\" />"
                + "  </setting>"
                + "</cec-settings>", null);
        assertThat(hdmiCecConfig.getAllowedIntValues(
@@ -556,10 +556,10 @@ public final class HdmiCecConfigTest {
                + "           value-type=\"int\""
                + "           user-configurable=\"true\">"
                + "    <allowed-values>"
                + "      <value hex-value=\"0x00\" />"
                + "      <value hex-value=\"0x01\" />"
                + "      <value int-value=\"0x00\" />"
                + "      <value int-value=\"0x01\" />"
                + "    </allowed-values>"
                + "    <default-value hex-value=\"0x01\" />"
                + "    <default-value int-value=\"0x01\" />"
                + "  </setting>"
                + "</cec-settings>", null);
        assertThat(hdmiCecConfig.getDefaultIntValue(
@@ -741,10 +741,10 @@ public final class HdmiCecConfigTest {
                + "           value-type=\"int\""
                + "           user-configurable=\"true\">"
                + "    <allowed-values>"
                + "      <value hex-value=\"0x0\" />"
                + "      <value hex-value=\"0x1\" />"
                + "      <value int-value=\"0x0\" />"
                + "      <value int-value=\"0x1\" />"
                + "    </allowed-values>"
                + "    <default-value hex-value=\"0x1\" />"
                + "    <default-value int-value=\"0x1\" />"
                + "  </setting>"
                + "</cec-settings>", null);
        assertThat(hdmiCecConfig.getIntValue(
@@ -988,10 +988,10 @@ public final class HdmiCecConfigTest {
                + "           value-type=\"int\""
                + "           user-configurable=\"true\">"
                + "    <allowed-values>"
                + "      <value hex-value=\"0x0\" />"
                + "      <value hex-value=\"0x1\" />"
                + "      <value int-value=\"0x0\" />"
                + "      <value int-value=\"0x1\" />"
                + "    </allowed-values>"
                + "    <default-value hex-value=\"0x1\" />"
                + "    <default-value int-value=\"0x1\" />"
                + "  </setting>"
                + "</cec-settings>", null);
        hdmiCecConfig.setIntValue(HdmiControlManager.CEC_SETTING_NAME_HDMI_CEC_ENABLED,