Android: Lint warning: use some explicit Locale

Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
This commit is contained in:
Sylvain
2025-09-18 21:13:39 +02:00
committed by Sam Lantinga
parent 8da1021b51
commit d631cf8409

View File

@@ -4,6 +4,7 @@ import android.hardware.usb.*;
import android.os.Build;
import android.util.Log;
import java.util.Arrays;
import java.util.Locale;
class HIDDeviceUSB implements HIDDevice {
@@ -31,7 +32,7 @@ class HIDDeviceUSB implements HIDDevice {
}
String getIdentifier() {
return String.format("%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);
return String.format(Locale.ENGLISH, "%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);
}
@Override