From 7de5f9984711d5907ffcd412f0fd53dea6300b6b Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Fri, 20 May 2022 12:04:13 +0800 Subject: [PATCH] The settings crash when it add the RTL mark on MEP message The MEP message string is one line, so it did not need to add more RTL marks. hsv: https://hsv.googleplex.com/5694452275347456 Bug: 233082642 Test: manually test and take the hsv. Change-Id: Iad4d469eb6a74805f3c8d5fe5c7eacea1e7a25d3 --- .../network/telephony/ToggleSubscriptionDialogActivity.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java index d348b24e58f..f5f18b4b9ee 100644 --- a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java +++ b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java @@ -460,13 +460,10 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc switchDialogMsg.append( getString(R.string.sim_action_switch_sub_dialog_mep_text, displayName)); if (isRtlMode) { - /* There are two lines of message in the dialog, and the RTL symbols must be added - * before and after each sentence, so use the line break symbol to find the position. + /* The RTL symbols must be added before and after each sentence. * (Each message are all with two line break symbols) */ switchDialogMsg.insert(0, RTL_MARK) - .insert(switchDialogMsg.indexOf(LINE_BREAK) - LINE_BREAK_OFFSET_ONE, RTL_MARK) - .insert(switchDialogMsg.indexOf(LINE_BREAK) + LINE_BREAK_OFFSET_TWO, RTL_MARK) .insert(switchDialogMsg.length(), RTL_MARK); } ConfirmDialogFragment.show(