Add a system property for the 'Set Menu Language' feature of CEC

The CEC feature, <Set Menu Language>, is enabled by setting a system
property 'ro.hdmi.set_menu_language', which is false by default.

Bug: 25704899
Change-Id: I941b238bcc06227c128f09d38d422b8295e81b7b
This commit is contained in:
Donghyun Cho
2016-03-11 17:35:37 +09:00
parent b39a4cdd64
commit a09256c72f
2 changed files with 10 additions and 0 deletions

View File

@@ -218,6 +218,9 @@ final class Constants {
// True by default.
static final String PROPERTY_WAKE_ON_HOTPLUG = "ro.hdmi.wake_on_hotplug";
// TODO(OEM): Set this to true to enable 'Set Menu Language' feature. False by default.
static final String PROPERTY_SET_MENU_LANGUAGE = "ro.hdmi.set_menu_language";
// Set to false to allow playback device to go to suspend mode even
// when it's an active source. True by default.
static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake";

View File

@@ -46,6 +46,9 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
private static final boolean WAKE_ON_HOTPLUG =
SystemProperties.getBoolean(Constants.PROPERTY_WAKE_ON_HOTPLUG, true);
private static final boolean SET_MENU_LANGUAGE =
SystemProperties.getBoolean(Constants.PROPERTY_SET_MENU_LANGUAGE, false);
private boolean mIsActiveSource = false;
// Used to keep the device awake while it is the active source. For devices that
@@ -316,6 +319,9 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
@ServiceThreadOnly
protected boolean handleSetMenuLanguage(HdmiCecMessage message) {
assertRunOnServiceThread();
if (!SET_MENU_LANGUAGE) {
return false;
}
try {
String iso3Language = new String(message.getParams(), 0, 3, "US-ASCII");
@@ -345,6 +351,7 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
Slog.w(TAG, "Can't handle <Set Menu Language> of " + iso3Language);
return false;
} catch (UnsupportedEncodingException e) {
Slog.w(TAG, "Can't handle <Set Menu Language>", e);
return false;
}
}