[Physical Keyboard] Show correct format in a11y key dialog

Format decimals in dialog to avoid inconsistent through languages.

Bug: 388330691
Test: atest SettingsRoboTests
Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled
Change-Id: Icbf1eec2b31614768efb079f4cbeec1fd5b73ef5
This commit is contained in:
shaoweishen
2025-01-10 09:49:29 +00:00
parent fd4c6d100d
commit f1ac7f64cb

View File

@@ -43,6 +43,7 @@ import com.android.settings.keyboard.Flags;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import java.text.NumberFormat;
import java.util.concurrent.TimeUnit;
/**
@@ -214,7 +215,7 @@ public abstract class InputSettingPreferenceController extends TogglePreferenceC
}
private static String progressToThresholdInSecond(int progress) {
return String.valueOf((double) progress * CUSTOM_PROGRESS_INTERVAL
return NumberFormat.getInstance().format((float) progress * CUSTOM_PROGRESS_INTERVAL
/ MILLISECOND_IN_SECONDS);
}