[Settings] Replace isVolteEnabledByPlatform

Replace ImsManager#isVolteEnabledByPlatform() by ImsMmTelManager#isSupport().

Bug: 140542283
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gLteSliceHelperTest
Change-Id: I656a00ad2c6120255e53d0b836945462258e01bb
This commit is contained in:
Bonian Chen
2020-02-09 23:16:29 +08:00
parent 64595f18d7
commit 1716548685
6 changed files with 125 additions and 15 deletions

View File

@@ -20,8 +20,10 @@ import android.content.Context;
import android.telecom.TelecomManager;
import android.telephony.AccessNetworkConstants;
import android.telephony.SubscriptionManager;
import android.telephony.ims.ImsException;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsRegistrationImplBase;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
@@ -34,6 +36,8 @@ import com.android.settings.network.telephony.MobileNetworkUtils;
*/
public class VolteQueryImsState extends ImsQueryController {
private static final String LOG_TAG = "VolteQueryImsState";
private Context mContext;
private int mSubId;
@@ -71,13 +75,15 @@ public class VolteQueryImsState extends ImsQueryController {
* @return true when VoLTE has been enabled, otherwise false
*/
public boolean isVoLteProvisioned() {
final ImsManager imsManager = getImsManager(mSubId);
if (imsManager == null) {
if (!isProvisionedOnDevice(mSubId)) {
return false;
}
return imsManager.isVolteEnabledByPlatform()
&& isProvisionedOnDevice(mSubId);
try {
return isEnabledByPlatform(mSubId);
} catch (InterruptedException | IllegalArgumentException | ImsException exception) {
Log.w(LOG_TAG, "fail to get VoLte supporting status. subId=" + mSubId, exception);
}
return false;
}
/**