Loading services/core/java/com/android/server/hdmi/DeviceSelectAction.java +10 −5 Original line number Diff line number Diff line Loading @@ -100,8 +100,13 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { // Wake-up on <Set Stream Path> was not mandatory before CEC 2.0. // The message is re-sent at the end of the action for devices that don't support 2.0. sendSetStreamPath(); int targetPowerStatus = localDevice().mService.getHdmiCecNetwork() .getCecDeviceInfo(getTargetAddress()).getDevicePowerStatus(); int targetPowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN; HdmiDeviceInfo targetDevice = localDevice().mService.getHdmiCecNetwork().getCecDeviceInfo( getTargetAddress()); if (targetDevice != null) { targetPowerStatus = targetDevice.getDevicePowerStatus(); } if (!mIsCec20 || targetPowerStatus == HdmiControlManager.POWER_STATUS_UNKNOWN) { queryDevicePowerStatus(); } else if (targetPowerStatus == HdmiControlManager.POWER_STATUS_ON) { Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +2 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,8 @@ abstract class HdmiCecLocalDevice { HdmiDeviceInfo cecDeviceInfo = mService.getHdmiCecNetwork().getCecDeviceInfo(address); // If no non-default display name is available for the device, request the devices OSD name. if (cecDeviceInfo.getDisplayName().equals(HdmiUtils.getDefaultDeviceName(address))) { if (cecDeviceInfo != null && cecDeviceInfo.getDisplayName().equals( HdmiUtils.getDefaultDeviceName(address))) { mService.sendCecCommand( HdmiCecMessageBuilder.buildGiveOsdNameCommand(mAddress, address)); } Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +3 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_ANAL import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_DIGITAL; import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_EXTERNAL; import android.annotation.Nullable; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.HdmiDeviceInfo; import android.hardware.hdmi.HdmiPortInfo; Loading Loading @@ -1147,6 +1148,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { && getAvrDeviceInfo() != null; } @Nullable @ServiceThreadOnly HdmiDeviceInfo getAvrDeviceInfo() { assertRunOnServiceThread(); Loading @@ -1157,6 +1159,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { return getSafeAvrDeviceInfo() != null; } @Nullable HdmiDeviceInfo getSafeAvrDeviceInfo() { return mService.getHdmiCecNetwork().getSafeCecDeviceInfo(Constants.ADDR_AUDIO_SYSTEM); } Loading services/core/java/com/android/server/hdmi/HdmiCecNetwork.java +7 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,12 @@ public class HdmiCecNetwork { mLocalDevices.clear(); } /** * Get the device info of a local device or a device in the CEC network by a device id. * @param id id of the device to get * @return the device with the given id, or {@code null} */ @Nullable public HdmiDeviceInfo getDeviceInfo(int id) { return mDeviceInfos.get(id); } Loading Loading @@ -717,6 +723,7 @@ public class HdmiCecNetwork { * @return {@link HdmiDeviceInfo} matched with the given {@code logicalAddress}. * Returns null if no logical address matched */ @Nullable HdmiDeviceInfo getSafeCecDeviceInfo(int logicalAddress) { for (HdmiDeviceInfo info : mSafeAllDeviceInfos) { if (info.isCecDevice() && info.getLogicalAddress() == logicalAddress) { Loading services/core/java/com/android/server/hdmi/HdmiControlService.java +1 −0 Original line number Diff line number Diff line Loading @@ -988,6 +988,7 @@ public class HdmiControlService extends SystemService { return mCecController.getVendorId(); } @Nullable @ServiceThreadOnly HdmiDeviceInfo getDeviceInfo(int logicalAddress) { assertRunOnServiceThread(); Loading Loading
services/core/java/com/android/server/hdmi/DeviceSelectAction.java +10 −5 Original line number Diff line number Diff line Loading @@ -100,8 +100,13 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { // Wake-up on <Set Stream Path> was not mandatory before CEC 2.0. // The message is re-sent at the end of the action for devices that don't support 2.0. sendSetStreamPath(); int targetPowerStatus = localDevice().mService.getHdmiCecNetwork() .getCecDeviceInfo(getTargetAddress()).getDevicePowerStatus(); int targetPowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN; HdmiDeviceInfo targetDevice = localDevice().mService.getHdmiCecNetwork().getCecDeviceInfo( getTargetAddress()); if (targetDevice != null) { targetPowerStatus = targetDevice.getDevicePowerStatus(); } if (!mIsCec20 || targetPowerStatus == HdmiControlManager.POWER_STATUS_UNKNOWN) { queryDevicePowerStatus(); } else if (targetPowerStatus == HdmiControlManager.POWER_STATUS_ON) { Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +2 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,8 @@ abstract class HdmiCecLocalDevice { HdmiDeviceInfo cecDeviceInfo = mService.getHdmiCecNetwork().getCecDeviceInfo(address); // If no non-default display name is available for the device, request the devices OSD name. if (cecDeviceInfo.getDisplayName().equals(HdmiUtils.getDefaultDeviceName(address))) { if (cecDeviceInfo != null && cecDeviceInfo.getDisplayName().equals( HdmiUtils.getDefaultDeviceName(address))) { mService.sendCecCommand( HdmiCecMessageBuilder.buildGiveOsdNameCommand(mAddress, address)); } Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +3 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_ANAL import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_DIGITAL; import static android.hardware.hdmi.HdmiControlManager.TIMER_RECORDING_TYPE_EXTERNAL; import android.annotation.Nullable; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.HdmiDeviceInfo; import android.hardware.hdmi.HdmiPortInfo; Loading Loading @@ -1147,6 +1148,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { && getAvrDeviceInfo() != null; } @Nullable @ServiceThreadOnly HdmiDeviceInfo getAvrDeviceInfo() { assertRunOnServiceThread(); Loading @@ -1157,6 +1159,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { return getSafeAvrDeviceInfo() != null; } @Nullable HdmiDeviceInfo getSafeAvrDeviceInfo() { return mService.getHdmiCecNetwork().getSafeCecDeviceInfo(Constants.ADDR_AUDIO_SYSTEM); } Loading
services/core/java/com/android/server/hdmi/HdmiCecNetwork.java +7 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,12 @@ public class HdmiCecNetwork { mLocalDevices.clear(); } /** * Get the device info of a local device or a device in the CEC network by a device id. * @param id id of the device to get * @return the device with the given id, or {@code null} */ @Nullable public HdmiDeviceInfo getDeviceInfo(int id) { return mDeviceInfos.get(id); } Loading Loading @@ -717,6 +723,7 @@ public class HdmiCecNetwork { * @return {@link HdmiDeviceInfo} matched with the given {@code logicalAddress}. * Returns null if no logical address matched */ @Nullable HdmiDeviceInfo getSafeCecDeviceInfo(int logicalAddress) { for (HdmiDeviceInfo info : mSafeAllDeviceInfos) { if (info.isCecDevice() && info.getLogicalAddress() == logicalAddress) { Loading
services/core/java/com/android/server/hdmi/HdmiControlService.java +1 −0 Original line number Diff line number Diff line Loading @@ -988,6 +988,7 @@ public class HdmiControlService extends SystemService { return mCecController.getVendorId(); } @Nullable @ServiceThreadOnly HdmiDeviceInfo getDeviceInfo(int logicalAddress) { assertRunOnServiceThread(); Loading