Implement powerOnRemoteDevice method

Bug: 159901363
Test: make
Change-Id: I0d53cb313b90e6d3bc505afde7991badc8631222
This commit is contained in:
Shraddha Basantwani
2020-08-07 18:38:09 +05:30
parent e3b0b6d007
commit ef89bf343c

View File

@@ -1809,7 +1809,21 @@ public class HdmiControlService extends SystemService {
@Override
public void powerOnRemoteDevice(int logicalAddress, int powerStatus) {
// TODO(amyjojo): implement the method
enforceAccessPermission();
runOnServiceThread(new Runnable() {
@Override
public void run() {
Slog.i(TAG, "Device "
+ logicalAddress + " power status is " + powerStatus
+ " before power on command sent out");
if (getSwitchDevice() != null) {
getSwitchDevice().sendUserControlPressedAndReleased(
logicalAddress, HdmiCecKeycode.CEC_KEYCODE_POWER_ON_FUNCTION);
} else {
Slog.e(TAG, "Can't get the correct local device to handle routing.");
}
}
});
}
@Override