summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Donghyun Cho <donghyun@google.com> 2016-03-11 17:35:37 +0900
committer Donghyun Cho <donghyun@google.com> 2016-03-16 11:34:54 +0900
commita09256c72f67010887f2a3801d4e1d27fa0ec2f7 (patch)
tree81afb1535842099bc16bb3ed63db79847124167f
parentb39a4cdd64edd3a9c3072408ae17ca343098ef87 (diff)
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
-rw-r--r--services/core/java/com/android/server/hdmi/Constants.java3
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java7
2 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/hdmi/Constants.java b/services/core/java/com/android/server/hdmi/Constants.java
index 8c12060abc06..603402e32bfb 100644
--- a/services/core/java/com/android/server/hdmi/Constants.java
+++ b/services/core/java/com/android/server/hdmi/Constants.java
@@ -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";
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
index 39c6732861f9..a36e6710887e 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
@@ -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;
}
}