Loading services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java +4 −7 Original line number Diff line number Diff line Loading @@ -333,7 +333,8 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction { current.mPhysicalAddress = HdmiUtils.twoBytesToInt(params); current.mPortId = getPortId(current.mPhysicalAddress); current.mDeviceType = params[2] & 0xFF; current.mDisplayName = HdmiUtils.getDefaultDeviceName(current.mDeviceType); // Keep display name empty. TIF fallbacks to the service label provided by the package mg. current.mDisplayName = ""; // This is to manager CEC device separately in case they don't have address. if (mIsTvDevice) { Loading @@ -359,17 +360,13 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction { return; } String displayName = null; String displayName = ""; try { if (cmd.getOpcode() == Constants.MESSAGE_FEATURE_ABORT) { displayName = HdmiUtils.getDefaultDeviceName(current.mLogicalAddress); } else { if (cmd.getOpcode() != Constants.MESSAGE_FEATURE_ABORT) { displayName = new String(cmd.getParams(), "US-ASCII"); } } catch (UnsupportedEncodingException e) { Slog.w(TAG, "Failed to decode display name: " + cmd.toString()); // If failed to get display name, use the default name of device. displayName = HdmiUtils.getDefaultDeviceName(current.mLogicalAddress); } current.mDisplayName = displayName; increaseProcessedDeviceCount(); Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +3 −2 Original line number Diff line number Diff line Loading @@ -489,7 +489,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (oldDevice == null || oldDevice.getPhysicalAddress() != path) { addCecDevice(new HdmiDeviceInfo( address, path, mService.pathToPortId(path), type, Constants.UNKNOWN_VENDOR_ID, HdmiUtils.getDefaultDeviceName(address))); Constants.UNKNOWN_VENDOR_ID, "")); // if we are adding a new device info, send out a give osd name command // to update the name of the device in TIF mService.sendCecCommand( Loading Loading @@ -526,7 +526,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { return true; } if (deviceInfo.getDisplayName().equals(osdName)) { if (deviceInfo.getDisplayName() != null && deviceInfo.getDisplayName().equals(osdName)) { Slog.d(TAG, "Ignore incoming <Set Osd Name> having same osd name:" + message); return true; } Loading Loading
services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java +4 −7 Original line number Diff line number Diff line Loading @@ -333,7 +333,8 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction { current.mPhysicalAddress = HdmiUtils.twoBytesToInt(params); current.mPortId = getPortId(current.mPhysicalAddress); current.mDeviceType = params[2] & 0xFF; current.mDisplayName = HdmiUtils.getDefaultDeviceName(current.mDeviceType); // Keep display name empty. TIF fallbacks to the service label provided by the package mg. current.mDisplayName = ""; // This is to manager CEC device separately in case they don't have address. if (mIsTvDevice) { Loading @@ -359,17 +360,13 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction { return; } String displayName = null; String displayName = ""; try { if (cmd.getOpcode() == Constants.MESSAGE_FEATURE_ABORT) { displayName = HdmiUtils.getDefaultDeviceName(current.mLogicalAddress); } else { if (cmd.getOpcode() != Constants.MESSAGE_FEATURE_ABORT) { displayName = new String(cmd.getParams(), "US-ASCII"); } } catch (UnsupportedEncodingException e) { Slog.w(TAG, "Failed to decode display name: " + cmd.toString()); // If failed to get display name, use the default name of device. displayName = HdmiUtils.getDefaultDeviceName(current.mLogicalAddress); } current.mDisplayName = displayName; increaseProcessedDeviceCount(); Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +3 −2 Original line number Diff line number Diff line Loading @@ -489,7 +489,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (oldDevice == null || oldDevice.getPhysicalAddress() != path) { addCecDevice(new HdmiDeviceInfo( address, path, mService.pathToPortId(path), type, Constants.UNKNOWN_VENDOR_ID, HdmiUtils.getDefaultDeviceName(address))); Constants.UNKNOWN_VENDOR_ID, "")); // if we are adding a new device info, send out a give osd name command // to update the name of the device in TIF mService.sendCecCommand( Loading Loading @@ -526,7 +526,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { return true; } if (deviceInfo.getDisplayName().equals(osdName)) { if (deviceInfo.getDisplayName() != null && deviceInfo.getDisplayName().equals(osdName)) { Slog.d(TAG, "Ignore incoming <Set Osd Name> having same osd name:" + message); return true; } Loading