In playback device, we don't track the port info, so we can't verify
the validity of the port id part of the physical address parameter of
HdmiCecMessages.
Bug:
16274232
Change-Id: I41f95dba0505d45688e2c9031b78863dc93248ce
}
private boolean isValidPhysicalAddress(byte[] params, int offset) {
+ // TODO: Add more logic like validating 1.0.1.0.
+
+ if (!mService.isTvDevice()) {
+ // If the device is not TV, we can't convert path to port-id, so stop here.
+ return true;
+ }
int path = HdmiUtils.twoBytesToInt(params, offset);
int portId = mService.pathToPortId(path);
if (portId == Constants.INVALID_PORT_ID) {
return false;
}
- // TODO: Add more logic like validating 1.0.1.0.
return true;
}
}
}
- private boolean isTvDevice() {
- return tv() != null;
- }
-
@Override
public void setProhibitMode(final boolean enabled) {
enforceAccessPermission();
return (HdmiCecLocalDeviceTv) mCecController.getLocalDevice(HdmiCecDeviceInfo.DEVICE_TV);
}
+ boolean isTvDevice() {
+ return tv() != null;
+ }
+
private HdmiCecLocalDevicePlayback playback() {
return (HdmiCecLocalDevicePlayback)
mCecController.getLocalDevice(HdmiCecDeviceInfo.DEVICE_PLAYBACK);