Merge "[Settings] Should not show WFC UI in the SIM page if the SIM does not support WFC" into udc-dev
This commit is contained in:
@@ -949,7 +949,12 @@ public class MobileNetworkUtils {
|
|||||||
boolean isWifiCallingEnabled;
|
boolean isWifiCallingEnabled;
|
||||||
if (phoneAccountHandle != null) {
|
if (phoneAccountHandle != null) {
|
||||||
final Intent intent = buildPhoneAccountConfigureIntent(context, phoneAccountHandle);
|
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 {
|
} else {
|
||||||
if (queryImsState == null) {
|
if (queryImsState == null) {
|
||||||
queryImsState = new WifiCallingQueryImsState(context, subId);
|
queryImsState = new WifiCallingQueryImsState(context, subId);
|
||||||
@@ -959,7 +964,6 @@ public class MobileNetworkUtils {
|
|||||||
return isWifiCallingEnabled;
|
return isWifiCallingEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns preferred status of Calls & SMS separately when Provider Model is enabled.
|
* Returns preferred status of Calls & SMS separately when Provider Model is enabled.
|
||||||
*/
|
*/
|
||||||
|
@@ -314,29 +314,13 @@ public class NetworkProviderWifiCallingGroup extends
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
protected boolean shouldShowWifiCallingForSub(int subId) {
|
protected boolean shouldShowWifiCallingForSub(int subId) {
|
||||||
if (SubscriptionManager.isValidSubscriptionId(subId)
|
if (SubscriptionManager.isValidSubscriptionId(subId)
|
||||||
&& MobileNetworkUtils.isWifiCallingEnabled(
|
&& MobileNetworkUtils.isWifiCallingEnabled(mContext, subId, queryImsState(subId),
|
||||||
mContext, subId, queryImsState(subId),
|
null)) {
|
||||||
getPhoneAccountHandleForSubscriptionId(subId))
|
|
||||||
&& isWifiCallingAvailableForCarrier(subId)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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
|
@Override
|
||||||
public String getPreferenceKey() {
|
public String getPreferenceKey() {
|
||||||
return KEY_PREFERENCE_WIFICALLING_GROUP;
|
return KEY_PREFERENCE_WIFICALLING_GROUP;
|
||||||
|
@@ -25,7 +25,6 @@ import android.provider.Settings;
|
|||||||
import android.telecom.PhoneAccountHandle;
|
import android.telecom.PhoneAccountHandle;
|
||||||
import android.telecom.TelecomManager;
|
import android.telecom.TelecomManager;
|
||||||
import android.telephony.CarrierConfigManager;
|
import android.telephony.CarrierConfigManager;
|
||||||
import android.telephony.PhoneStateListener;
|
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyCallback;
|
import android.telephony.TelephonyCallback;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
@@ -257,7 +257,8 @@ public class WifiCallingSettings extends SettingsPreferenceFragment
|
|||||||
for (SubscriptionInfo subInfo : subInfoList) {
|
for (SubscriptionInfo subInfo : subInfoList) {
|
||||||
int subId = subInfo.getSubscriptionId();
|
int subId = subInfo.getSubscriptionId();
|
||||||
try {
|
try {
|
||||||
if (queryImsState(subId).isWifiCallingProvisioned()) {
|
if (MobileNetworkUtils.isWifiCallingEnabled(getContext(), subId,
|
||||||
|
queryImsState(subId), null)) {
|
||||||
selectedList.add(subInfo);
|
selectedList.add(subInfo);
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {}
|
} catch (Exception exception) {}
|
||||||
|
Reference in New Issue
Block a user