CEC: Explicitly turn on screen for remote control passthrough

Ensures that the playback device turns on display output signal
upon receiving CEC command <User Control Pressed>.

Bug: 19518981
Change-Id: I4f898380c9ffc071da2357a51e61309ae5d233f5
(cherry picked from commit 9b8507c52ae845c8eed9fd9952bf66538934b8fd)
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
index a8f6954..8034809 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
@@ -179,6 +179,13 @@
         }
     }
 
+    @ServiceThreadOnly
+    protected boolean handleUserControlPressed(HdmiCecMessage message) {
+        assertRunOnServiceThread();
+        wakeUpIfActiveSource();
+        return super.handleUserControlPressed(message);
+    }
+
     @Override
     @ServiceThreadOnly
     protected boolean handleSetStreamPath(HdmiCecMessage message) {
@@ -216,7 +223,12 @@
     }
 
     private void wakeUpIfActiveSource() {
-        if (mIsActiveSource && mService.isPowerStandbyOrTransient()) {
+        if (!mIsActiveSource) {
+            return;
+        }
+        // Wake up the device if the power is in standby mode, or its screen is off -
+        // which can happen if the device is holding a partial lock.
+        if (mService.isPowerStandbyOrTransient() || !mService.getPowerManager().isScreenOn()) {
             mService.wakeUp();
         }
     }