[Audiosharing] Update cancel btn label.

When broadcast is off, the negative btn of share audio dialog should be
"Switch to xxx"

Test: atest
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Bug: 305620450
Change-Id: I8006e2901b8f859d1ee86cbf12d81401e004aa0f
This commit is contained in:
Yiyi Shen
2024-09-02 18:50:13 +08:00
parent e4505fecb7
commit db89eaa0a2
2 changed files with 18 additions and 1 deletions

View File

@@ -158,7 +158,11 @@ public class AudioSharingJoinDialogFragment extends InstrumentedDialogFragment {
dismiss();
})
.setCustomNegativeButton(
R.string.audio_sharing_no_thanks_button_label,
getMetricsCategory() == SettingsEnums.DIALOG_START_AUDIO_SHARING
? getString(
R.string.audio_sharing_switch_active_button_label,
newDeviceName)
: getString(R.string.audio_sharing_no_thanks_button_label),
v -> {
if (sListener != null) {
sListener.onCancelClick();