[Audiosharing] Apply new string resid

Test: atest
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Bug: 362858921
Bug: 362858894
Change-Id: I4c80d834515e43bade5f2207dc013dc30c6ab7be
This commit is contained in:
Yiyi Shen
2024-09-23 12:03:06 +08:00
parent 7a91f6e7bf
commit 5ea28f5f0a
9 changed files with 40 additions and 35 deletions

View File

@@ -359,7 +359,7 @@ public abstract class BluetoothDevicePairingDetailBase extends DeviceListPrefere
String aliasName = device.getAlias();
String deviceName = TextUtils.isEmpty(aliasName) ? device.getAddress()
: aliasName;
showConnectingDialog("Connecting to " + deviceName + "...");
showConnectingDialog(deviceName);
// Wait for AUTO_DISMISS_TIME_THRESHOLD_MS and check if the paired device supports audio
// sharing.
if (!mHandler.hasMessages(AUTO_DISMISS_MESSAGE_ID)) {
@@ -385,14 +385,15 @@ public abstract class BluetoothDevicePairingDetailBase extends DeviceListPrefere
}
// TODO: use DialogFragment
private void showConnectingDialog(@NonNull String message) {
private void showConnectingDialog(@NonNull String deviceName) {
postOnMainThread(() -> {
String message = getContext().getString(R.string.progress_dialog_connect_device_content,
deviceName);
if (mProgressDialog != null) {
Log.d(getLogTag(), "showConnectingDialog, is already showing");
TextView textView = mProgressDialog.findViewById(R.id.message);
if (textView != null && !message.equals(textView.getText().toString())) {
Log.d(getLogTag(), "showConnectingDialog, update message");
// TODO: use string res once finalized
textView.setText(message);
}
return;
@@ -405,7 +406,6 @@ public abstract class BluetoothDevicePairingDetailBase extends DeviceListPrefere
null);
TextView textView = customView.findViewById(R.id.message);
if (textView != null) {
// TODO: use string res once finalized
textView.setText(message);
}
AlertDialog dialog = builder.setView(customView).setCancelable(false).create();