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

Commit 502ba07d authored by Michal Olech's avatar Michal Olech Committed by Android (Google) Code Review
Browse files

Merge "[CEC Configuration] Move master configuration from '/product/etc' to '/system/etc'"

parents 3f7ed056 23dcad50
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -604,8 +604,9 @@ java_defaults {
    ],
    required: [
        "framework-platform-compat-config",
        // TODO: remove gps_debug and protolog.conf.json when the build system propagates "required" properly.
        // TODO: remove gps_debug, cec_config.xml and protolog.conf.json when the build system propagates "required" properly.
        "gps_debug.conf",
        "cec_config.xml",
        "icu4j-platform-compat-config",
        "libcore-platform-compat-config",
        "protolog.conf.json.gz",
+6 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ java_library_static {
    ],

    required: [
        "cec_config.xml",
        "gps_debug.conf",
        "protolog.conf.json.gz",
    ],
@@ -171,6 +172,11 @@ java_library_host {
    srcs: ["java/com/android/server/notification/SmallHash.java"]
}

prebuilt_etc {
    name: "cec_config.xml",
    src: "java/com/android/server/hdmi/cec_config.xml",
}

prebuilt_etc {
    name: "gps_debug.conf",
    src: "java/com/android/server/location/gnss/gps_debug.conf",
+14 −14
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class HdmiCecConfig {

    @NonNull private final Context mContext;
    @NonNull private final StorageAdapter mStorageAdapter;
    @Nullable private final CecSettings mProductConfig;
    @Nullable private final CecSettings mSystemConfig;
    @Nullable private final CecSettings mVendorOverride;

    /**
@@ -162,14 +162,14 @@ public class HdmiCecConfig {
    @VisibleForTesting
    HdmiCecConfig(@NonNull Context context,
                  @NonNull StorageAdapter storageAdapter,
                  @Nullable CecSettings productConfig,
                  @Nullable CecSettings systemConfig,
                  @Nullable CecSettings vendorOverride) {
        mContext = context;
        mStorageAdapter = storageAdapter;
        mProductConfig = productConfig;
        mSystemConfig = systemConfig;
        mVendorOverride = vendorOverride;
        if (mProductConfig == null) {
            Slog.i(TAG, "CEC master configuration XML missing.");
        if (mSystemConfig == null) {
            Slog.i(TAG, "CEC system configuration XML missing.");
        }
        if (mVendorOverride == null) {
            Slog.i(TAG, "CEC OEM configuration override XML missing.");
@@ -178,7 +178,7 @@ public class HdmiCecConfig {

    HdmiCecConfig(@NonNull Context context) {
        this(context, new StorageAdapter(context),
             readSettingsFromFile(Environment.buildPath(Environment.getProductDirectory(),
             readSettingsFromFile(Environment.buildPath(Environment.getRootDirectory(),
                                                        ETC_DIR, CONFIG_FILE)),
             readSettingsFromFile(Environment.buildPath(Environment.getVendorDirectory(),
                                                        ETC_DIR, CONFIG_FILE)));
@@ -226,7 +226,7 @@ public class HdmiCecConfig {

    @Nullable
    private Setting getSetting(@NonNull String name) {
        if (mProductConfig == null) {
        if (mSystemConfig == null) {
            return null;
        }
        if (mVendorOverride != null) {
@@ -237,8 +237,8 @@ public class HdmiCecConfig {
                }
            }
        }
        // If not found, try the product config.
        for (Setting setting : mProductConfig.getSetting()) {
        // If not found, try the system config.
        for (Setting setting : mSystemConfig.getSetting()) {
            if (setting.getName().equals(name)) {
                return setting;
            }
@@ -322,11 +322,11 @@ public class HdmiCecConfig {
     * Returns a list of all settings based on the XML metadata.
     */
    public @CecSettingName List<String> getAllSettings() {
        if (mProductConfig == null) {
        if (mSystemConfig == null) {
            return new ArrayList<String>();
        }
        List<String> allSettings = new ArrayList<String>();
        for (Setting setting : mProductConfig.getSetting()) {
        for (Setting setting : mSystemConfig.getSetting()) {
            allSettings.add(setting.getName());
        }
        return allSettings;
@@ -336,12 +336,12 @@ public class HdmiCecConfig {
     * Returns a list of user-modifiable settings based on the XML metadata.
     */
    public @CecSettingName List<String> getUserSettings() {
        if (mProductConfig == null) {
        if (mSystemConfig == null) {
            return new ArrayList<String>();
        }
        Set<String> userSettings = new HashSet<String>();
        // First read from the product config.
        for (Setting setting : mProductConfig.getSetting()) {
        // First read from the system config.
        for (Setting setting : mSystemConfig.getSetting()) {
            if (setting.getUserConfigurable()) {
                userSettings.add(setting.getName());
            }
+49 −0
Original line number Diff line number Diff line
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<cec-settings>
  <setting name="hdmi_cec_enabled"
           value-type="int"
           user-configurable="true">
    <allowed-values>
      <value int-value="0" />
      <value int-value="1" />
    </allowed-values>
    <default-value int-value="1" />
  </setting>
  <setting name="hdmi_cec_version"
           value-type="int"
           user-configurable="true">
    <allowed-values>
      <value int-value="0x05" />
      <value int-value="0x06" />
    </allowed-values>
    <default-value int-value="0x05" />
  </setting>
  <setting name="send_standby_on_sleep"
           value-type="string"
           user-configurable="true">
    <allowed-values>
      <value string-value="to_tv" />
      <value string-value="broadcast" />
      <value string-value="none" />
    </allowed-values>
    <default-value string-value="to_tv" />
  </setting>
  <setting name="power_state_change_on_active_source_lost"
           value-type="string"
           user-configurable="true">
    <allowed-values>
      <value string-value="none" />
      <value string-value="standby_now" />
    </allowed-values>
    <default-value string-value="none" />
  </setting>
  <setting name="system_audio_mode_muting"
           value-type="int"
           user-configurable="true">
    <allowed-values>
      <value int-value="0" />
      <value int-value="1" />
    </allowed-values>
    <default-value int-value="1" />
  </setting>
</cec-settings>