Show VoLTE UI when VoIMS opt-in enabled
Show VoLTE settings if VoIMS opt-in has been enabled irrespective of other VoLTE settings. Bug: 177010560 Test: Override hide_enhanced_4g_lte_bool to true and check the UI. Change-Id: Ib305bae904f0028571874e204a415dfcd4457982
This commit is contained in:
@@ -16,11 +16,14 @@
|
|||||||
|
|
||||||
package com.android.settings.network.ims;
|
package com.android.settings.network.ims;
|
||||||
|
|
||||||
|
import static android.telephony.ims.ProvisioningManager.KEY_VOIMS_OPT_IN_STATUS;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.telecom.TelecomManager;
|
import android.telecom.TelecomManager;
|
||||||
import android.telephony.AccessNetworkConstants;
|
import android.telephony.AccessNetworkConstants;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.ims.ImsException;
|
import android.telephony.ims.ImsException;
|
||||||
|
import android.telephony.ims.ProvisioningManager;
|
||||||
import android.telephony.ims.feature.MmTelFeature;
|
import android.telephony.ims.feature.MmTelFeature;
|
||||||
import android.telephony.ims.stub.ImsRegistrationImplBase;
|
import android.telephony.ims.stub.ImsRegistrationImplBase;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -133,4 +136,15 @@ public class VolteQueryImsState extends ImsQueryController {
|
|||||||
}
|
}
|
||||||
return isEnabledByUser(mSubId);
|
return isEnabledByUser(mSubId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get VoIMS opt-in configuration.
|
||||||
|
*
|
||||||
|
* @return true when VoIMS opt-in has been enabled, otherwise false
|
||||||
|
*/
|
||||||
|
public boolean isVoImsOptInEnabled() {
|
||||||
|
int voImsOptInStatus = ProvisioningManager.createForSubscriptionId(mSubId)
|
||||||
|
.getProvisioningIntValue(KEY_VOIMS_OPT_IN_STATUS);
|
||||||
|
return voImsOptInStatus == ProvisioningManager.PROVISIONING_VALUE_ENABLED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -107,12 +107,18 @@ public class Enhanced4gBasePreferenceController extends TelephonyTogglePreferenc
|
|||||||
if (!isModeMatched()) {
|
if (!isModeMatched()) {
|
||||||
return CONDITIONALLY_UNAVAILABLE;
|
return CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
final VolteQueryImsState queryState = queryImsState(subId);
|
||||||
|
// Show VoLTE settings if VoIMS opt-in has been enabled irrespective of other VoLTE settings
|
||||||
|
if (queryState.isVoImsOptInEnabled()) {
|
||||||
|
return AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
final PersistableBundle carrierConfig = getCarrierConfigForSubId(subId);
|
final PersistableBundle carrierConfig = getCarrierConfigForSubId(subId);
|
||||||
if ((carrierConfig == null)
|
if ((carrierConfig == null)
|
||||||
|| carrierConfig.getBoolean(CarrierConfigManager.KEY_HIDE_ENHANCED_4G_LTE_BOOL)) {
|
|| carrierConfig.getBoolean(CarrierConfigManager.KEY_HIDE_ENHANCED_4G_LTE_BOOL)) {
|
||||||
return CONDITIONALLY_UNAVAILABLE;
|
return CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
final VolteQueryImsState queryState = queryImsState(subId);
|
|
||||||
if (!queryState.isReadyToVoLte()) {
|
if (!queryState.isReadyToVoLte()) {
|
||||||
return CONDITIONALLY_UNAVAILABLE;
|
return CONDITIONALLY_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user