OSDN Git Service

CEC: Support sendStandby() for MHL device
authorJinsuk Kim <jinsukkim@google.com>
Wed, 14 Jan 2015 22:00:28 +0000 (07:00 +0900)
committerJinsuk Kim <jinsukkim@google.com>
Wed, 14 Jan 2015 22:12:50 +0000 (07:12 +0900)
Changed so that the API sendStandby() transform the request to
a MHL subcommand if the call is done against a MHL device.

Also hooked up the dump() to print out information on MHL.

Bug: 18451257
Change-Id: I1927855e0e4c45a731f0fd97ba572bfc2a894557

services/core/java/com/android/server/hdmi/HdmiControlService.java
services/core/java/com/android/server/hdmi/HdmiMhlControllerStub.java
services/core/java/com/android/server/hdmi/HdmiMhlLocalDeviceStub.java

index 2593e2b..cc8c53c 100644 (file)
@@ -1427,6 +1427,11 @@ public final class HdmiControlService extends SystemService {
             runOnServiceThread(new Runnable() {
                 @Override
                 public void run() {
+                    HdmiMhlLocalDeviceStub mhlDevice = mMhlController.getLocalDeviceById(deviceId);
+                    if (mhlDevice != null) {
+                        mhlDevice.sendStandby();
+                        return;
+                    }
                     HdmiCecLocalDevice device = mCecController.getLocalDevice(deviceType);
                     if (device == null) {
                         Slog.w(TAG, "Local device not available");
@@ -1546,6 +1551,12 @@ public final class HdmiControlService extends SystemService {
                 mCecController.dump(pw);
                 pw.decreaseIndent();
             }
+
+            pw.println("mMhlController: ");
+            pw.increaseIndent();
+            mMhlController.dump(pw);
+            pw.decreaseIndent();
+
             pw.println("mPortInfo: ");
             pw.increaseIndent();
             for (HdmiPortInfo hdmiPortInfo : mPortInfo) {
index 708aee6..3883200 100644 (file)
@@ -19,6 +19,7 @@ package com.android.server.hdmi;
 import android.hardware.hdmi.HdmiPortInfo;
 import android.util.SparseArray;
 
+import com.android.internal.util.IndentingPrintWriter;
 import com.android.server.hdmi.HdmiControlService.SendMessageCallback;
 
 /**
@@ -135,4 +136,7 @@ final class HdmiMhlControllerStub {
     int getEcbusDeviceRoles(int portId) {
         return INVALID_DEVICE_ROLES;
     }
+
+    void dump(IndentingPrintWriter pw) {
+    }
 }
index 53a7c5c..06ecb5a 100644 (file)
@@ -43,4 +43,7 @@ final class HdmiMhlLocalDeviceStub {
 
     void sendKeyEvent(int keycode, boolean isPressed) {
     }
+
+    void sendStandby() {
+    }
 }