am dd0f3964: Merge "CEC: Make wakeup on hotplug optional" into mnc-dev
* commit 'dd0f3964ef0bb6c04eb295119a2c7355125332d0': CEC: Make wakeup on hotplug optional
This commit is contained in:
@@ -214,6 +214,10 @@ final class Constants {
|
|||||||
// values which denotes the device type in HDMI Spec 1.4.
|
// values which denotes the device type in HDMI Spec 1.4.
|
||||||
static final String PROPERTY_DEVICE_TYPE = "ro.hdmi.device_type";
|
static final String PROPERTY_DEVICE_TYPE = "ro.hdmi.device_type";
|
||||||
|
|
||||||
|
// TODO(OEM): Set this to false to keep the playback device in sleep upon hotplug event.
|
||||||
|
// True by default.
|
||||||
|
static final String PROPERTY_WAKE_ON_HOTPLUG = "ro.hdmi.wake_on_hotplug";
|
||||||
|
|
||||||
// Set to false to allow playback device to go to suspend mode even
|
// Set to false to allow playback device to go to suspend mode even
|
||||||
// when it's an active source. True by default.
|
// when it's an active source. True by default.
|
||||||
static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake";
|
static final String PROPERTY_KEEP_AWAKE = "persist.sys.hdmi.keep_awake";
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ import com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly;
|
|||||||
final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
|
final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
|
||||||
private static final String TAG = "HdmiCecLocalDevicePlayback";
|
private static final String TAG = "HdmiCecLocalDevicePlayback";
|
||||||
|
|
||||||
|
private static final boolean WAKE_ON_HOTPLUG =
|
||||||
|
SystemProperties.getBoolean(Constants.PROPERTY_WAKE_ON_HOTPLUG, true);
|
||||||
|
|
||||||
private boolean mIsActiveSource = false;
|
private boolean mIsActiveSource = false;
|
||||||
|
|
||||||
// Used to keep the device awake while it is the active source. For devices that
|
// Used to keep the device awake while it is the active source. For devices that
|
||||||
@@ -130,7 +133,7 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDevice {
|
|||||||
assertRunOnServiceThread();
|
assertRunOnServiceThread();
|
||||||
mCecMessageCache.flushAll();
|
mCecMessageCache.flushAll();
|
||||||
// We'll not clear mIsActiveSource on the hotplug event to pass CETC 11.2.2-2 ~ 3.
|
// We'll not clear mIsActiveSource on the hotplug event to pass CETC 11.2.2-2 ~ 3.
|
||||||
if (connected && mService.isPowerStandbyOrTransient()) {
|
if (WAKE_ON_HOTPLUG && connected && mService.isPowerStandbyOrTransient()) {
|
||||||
mService.wakeUp();
|
mService.wakeUp();
|
||||||
}
|
}
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
|
|||||||
Reference in New Issue
Block a user