From a09256c72f67010887f2a3801d4e1d27fa0ec2f7 Mon Sep 17 00:00:00 2001 From: Donghyun Cho Date: Fri, 11 Mar 2016 17:35:37 +0900 Subject: Add a system property for the 'Set Menu Language' feature of CEC The CEC feature, , is enabled by setting a system property 'ro.hdmi.set_menu_language', which is false by default. Bug: 25704899 Change-Id: I941b238bcc06227c128f09d38d422b8295e81b7b --- services/core/java/com/android/server/hdmi/Constants.java | 3 +++ .../java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java | 7 +++++++ 2 files changed, 10 insertions(+) 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 of " + iso3Language); return false; } catch (UnsupportedEncodingException e) { + Slog.w(TAG, "Can't handle ", e); return false; } } -- cgit v1.2.3-59-g8ed1b