Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b208658 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

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
parent 16ed7e70
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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 =