Resolve the SIM call manager per subId
The SIM call manager used to be resolved based on what the default voice subscription ID was. This caused settings to be displayed for the incorrect subscription. A new API has been added that allows settings to query the SIM call manager per subId. Test: manual, unit testing Bug: 131627085 Change-Id: I7699508429f7df7a138c24c4c7a6e9f1148b84da
This commit is contained in:
@@ -68,7 +68,6 @@ public class WifiCallingPreferenceController extends TelephonyBasePreferenceCont
|
||||
super(context, key);
|
||||
mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
|
||||
mTelephonyManager = context.getSystemService(TelephonyManager.class);
|
||||
mSimCallManager = context.getSystemService(TelecomManager.class).getSimCallManager();
|
||||
mPhoneStateListener = new PhoneCallStateListener(Looper.getMainLooper());
|
||||
mEditableWfcRoamingMode = true;
|
||||
mUseWfcHomeModeForRoaming = false;
|
||||
@@ -77,8 +76,7 @@ public class WifiCallingPreferenceController extends TelephonyBasePreferenceCont
|
||||
@Override
|
||||
public int getAvailabilityStatus(int subId) {
|
||||
return subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
&& MobileNetworkUtils.isWifiCallingEnabled(mContext,
|
||||
SubscriptionManager.getPhoneId(subId))
|
||||
&& MobileNetworkUtils.isWifiCallingEnabled(mContext, subId)
|
||||
? AVAILABLE
|
||||
: UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
@@ -155,6 +153,8 @@ public class WifiCallingPreferenceController extends TelephonyBasePreferenceCont
|
||||
mSubId = subId;
|
||||
mTelephonyManager = TelephonyManager.from(mContext).createForSubscriptionId(mSubId);
|
||||
mImsManager = ImsManager.getInstance(mContext, SubscriptionManager.getPhoneId(mSubId));
|
||||
mSimCallManager = mContext.getSystemService(TelecomManager.class)
|
||||
.getSimCallManagerForSubscription(mSubId);
|
||||
if (mCarrierConfigManager != null) {
|
||||
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
|
||||
if (carrierConfig != null) {
|
||||
|
Reference in New Issue
Block a user