Fix issue that the wifi calling text cannot be customized based on sim
Some carriers have requirements that the wifi calling text should be
customizable. However, the resources for the wifi calling text are
not obtained based on sim. So it cannot be customized per sim for multi
sim device. To solve this issue, obtain the resources with specified
sim.
Test: manual - Checked that the wifi calling text could be customized
based on sim.
Bug: 117257109
Change-Id: Ifb6025cb7c95bfb43c1d0f2d07d4246be77b3039
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 3693fc8..fb1e3e4 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -37,6 +37,7 @@
import android.telecom.TelecomManager;
import android.telephony.CarrierConfigManager;
import android.telephony.PhoneStateListener;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.ims.feature.ImsFeature;
import android.util.Log;
@@ -376,6 +377,10 @@
} else if (!mImsMgr.isWfcEnabledByPlatform() || !mImsMgr.isWfcProvisionedOnDevice()) {
prefSet.removePreference(mButtonWifiCalling);
} else {
+ String title = SubscriptionManager.getResourcesForSubId(mPhone.getContext(),
+ mPhone.getSubId()).getString(R.string.wifi_calling);
+ mButtonWifiCalling.setTitle(title);
+
int resId = com.android.internal.R.string.wifi_calling_off_summary;
if (mImsMgr.isWfcEnabledByUser()) {
boolean isRoaming = telephonyManager.isNetworkRoaming();