Merge "[Settings] Should not show WFC UI in the SIM page if the SIM does not support WFC" into udc-dev am: 7a492b4098
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22135681 Change-Id: I81549c19fffa32e95b506bf5d6df8166800db21c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -949,7 +949,12 @@ public class MobileNetworkUtils {
|
||||
boolean isWifiCallingEnabled;
|
||||
if (phoneAccountHandle != null) {
|
||||
final Intent intent = buildPhoneAccountConfigureIntent(context, phoneAccountHandle);
|
||||
isWifiCallingEnabled = intent != null;
|
||||
if (intent == null) {
|
||||
Log.d(TAG, "Can not get phoneAccount configure intent.");
|
||||
isWifiCallingEnabled = false;
|
||||
} else {
|
||||
isWifiCallingEnabled = true;
|
||||
}
|
||||
} else {
|
||||
if (queryImsState == null) {
|
||||
queryImsState = new WifiCallingQueryImsState(context, subId);
|
||||
@@ -959,7 +964,6 @@ public class MobileNetworkUtils {
|
||||
return isWifiCallingEnabled;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns preferred status of Calls & SMS separately when Provider Model is enabled.
|
||||
*/
|
||||
|
@@ -314,29 +314,13 @@ public class NetworkProviderWifiCallingGroup extends
|
||||
@VisibleForTesting
|
||||
protected boolean shouldShowWifiCallingForSub(int subId) {
|
||||
if (SubscriptionManager.isValidSubscriptionId(subId)
|
||||
&& MobileNetworkUtils.isWifiCallingEnabled(
|
||||
mContext, subId, queryImsState(subId),
|
||||
getPhoneAccountHandleForSubscriptionId(subId))
|
||||
&& isWifiCallingAvailableForCarrier(subId)) {
|
||||
&& MobileNetworkUtils.isWifiCallingEnabled(mContext, subId, queryImsState(subId),
|
||||
null)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isWifiCallingAvailableForCarrier(int subId) {
|
||||
boolean isWifiCallingAvailableForCarrier = false;
|
||||
if (mCarrierConfigManager != null) {
|
||||
final PersistableBundle carrierConfig =
|
||||
mCarrierConfigManager.getConfigForSubId(subId);
|
||||
if (carrierConfig != null) {
|
||||
isWifiCallingAvailableForCarrier = carrierConfig.getBoolean(
|
||||
CarrierConfigManager.KEY_CARRIER_WFC_IMS_AVAILABLE_BOOL);
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "isWifiCallingAvailableForCarrier:" + isWifiCallingAvailableForCarrier);
|
||||
return isWifiCallingAvailableForCarrier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_PREFERENCE_WIFICALLING_GROUP;
|
||||
|
@@ -25,7 +25,6 @@ import android.provider.Settings;
|
||||
import android.telecom.PhoneAccountHandle;
|
||||
import android.telecom.TelecomManager;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
import android.telephony.PhoneStateListener;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyCallback;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
@@ -257,7 +257,8 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
||||
for (SubscriptionInfo subInfo : subInfoList) {
|
||||
int subId = subInfo.getSubscriptionId();
|
||||
try {
|
||||
if (queryImsState(subId).isWifiCallingProvisioned()) {
|
||||
if (MobileNetworkUtils.isWifiCallingEnabled(getContext(), subId,
|
||||
queryImsState(subId), null)) {
|
||||
selectedList.add(subInfo);
|
||||
}
|
||||
} catch (Exception exception) {}
|
||||
|
Reference in New Issue
Block a user