TIF: Generate hardware input id in language-neutral fashion

For certain RtoL languages, digit used as a part of input id
(like HW0) is also localized, hence language change results in
the duplicated inputs for an identical hardware. This CL
changes the way the id is built to language-neutral fashion,
and keeps the digit used in the id in Arabic.

Bug: 21523750
Change-Id: I8f95e0209eeee16ceb543e574ef9ed572e4d031f
This commit is contained in:
Jinsuk Kim
2015-06-04 13:40:38 +09:00
parent 16ed7e70c8
commit 4b20865817

View File

@@ -549,8 +549,9 @@ public final class TvInputInfo implements Parcelable {
private static final String generateInputIdForHdmiDevice(
ComponentName name, HdmiDeviceInfo deviceInfo) {
// Example of the format : "/HDMI%04X%02X"
String format = String.format("%s%s%%0%sX%%0%sX", DELIMITER_INFO_IN_ID, PREFIX_HDMI_DEVICE,
LENGTH_HDMI_PHYSICAL_ADDRESS, LENGTH_HDMI_DEVICE_ID);
String format = DELIMITER_INFO_IN_ID + PREFIX_HDMI_DEVICE
+ "%0" + LENGTH_HDMI_PHYSICAL_ADDRESS + "X"
+ "%0" + LENGTH_HDMI_DEVICE_ID + "X";
return name.flattenToShortString() + String.format(format,
deviceInfo.getPhysicalAddress(), deviceInfo.getId());
}
@@ -564,8 +565,8 @@ public final class TvInputInfo implements Parcelable {
*/
private static final String generateInputIdForHardware(
ComponentName name, TvInputHardwareInfo hardwareInfo) {
return name.flattenToShortString() + String.format("%s%s%d",
DELIMITER_INFO_IN_ID, PREFIX_HARDWARE_DEVICE, hardwareInfo.getDeviceId());
return name.flattenToShortString() + DELIMITER_INFO_IN_ID + PREFIX_HARDWARE_DEVICE
+ hardwareInfo.getDeviceId();
}
public static final Parcelable.Creator<TvInputInfo> CREATOR =