MSIM Ringtone: Improve on devices with ESIM

Change-Id: Ib0e0348b29d9bcb567f2d3c0725dd6950a3bbc1e
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
jhenrique09
2021-12-11 14:23:43 -03:00
committed by Joey
parent 2ad3bcbcd7
commit 7c29c1956b
3 changed files with 20 additions and 4 deletions

View File

@@ -44,12 +44,10 @@ public class PhoneRingtonePreferenceController extends RingtonePreferenceControl
TelephonyManager telephonyManager =
(TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
if (telephonyManager.isMultiSimEnabled()) {
// For Multi SIM device, shoud show "Phone ringtone - SIM 1" for slot1 ringtone setting.
if (telephonyManager.isMultiSimEnabled() && !isDeviceSupportsESIM()) {
DefaultRingtonePreference ringtonePreference =
(DefaultRingtonePreference) screen.findPreference(KEY_PHONE_RINGTONE);
ringtonePreference.setTitle(mContext.getString(R.string.ringtone_title) + " - " +
String.format(mContext.getString(R.string.sim_card_number_title), 1));
ringtonePreference.setTitle(mContext.getString(R.string.ringtone_title));
ringtonePreference.setEnabled(hasCard());
}
}