Android 8.0 Volte开关流程 HD图标显示

本文详细介绍了Android 8.0中Volte开关的设置流程,涉及MobileNetWorkSettings.java中的关键代码,ImsManager类的setEnhanced4gLteModeSettingForSlot方法,以及ImsConfig.java中的setFeatureValue()方法。在Android 8.0中,与之前版本相比,该流程有所变化,包括运载配置和subId的使用。文章还解释了ImsServiceProxy的实现和ImsServiceSub中的updateHDIcon()方法如何更新状态栏HD图标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

android 8.0的Volte开关流程

Volte按钮:

vendor/qcom/proprietary/telephont-app/NetworkSetting/src/com/qualcomm/qti/networksetting/MoblieNetWorkSettings.java中key为_"enhanced_4g_lte"的SwitchPreference就是设置中的Votle开关。

     boolean enhanced4gMode = !enhanced4gModePref.isChecked(); 
mImsMgr.setEnhanced4gLteModeSettingForSlot(enhanced4gModePref.isChecked());

上两行代码就是按钮相关的设置。
调用ImsManager中的setEnhanced4gLteModeSettingForSlot方法来进行设置。ImsManage路径:android\frameworks\opt\net\ims\src\java\com\android\ims\ImsManager。
~
~

ImsManage.java

 public void setEnhanced4gLteModeSettingForSlot(boolean enabled) {
        // If false, we must always keep advanced 4G mode set to true (1).
        int value = getBooleanCarrierConfigForSlot(
                CarrierConfigManager.KEY_EDITABLE_ENHANCED_4G_LTE_BOOL) ? (enabled ? 1: 0) : 1;
        int subId = getSubId(mPhoneId);

        log("setEnhanced4gLteModeSettingForSlot :: subId=" + subId + " enabled=" + enabled);
        try {
            int prevSetting = android.provider.Settings.Global.getInt(mContext.getContentResolver(),
                    android.provider.Settings.Global.ENHANCED_4G_MODE_ENABLED + subId);
            if (prevSetting == value) {
                // Don't trigger setAdvanced4GMode if the setting hasn't changed.
                return;
            }
        } catch (Settings.SettingNotFoundException e) {
            // Setting doesn't exist yet, so set it below.
        }

        android.provider.Settings.Global.putInt(mContext.getContentResolver(),
                android.provider.Settings.Global.ENHANCED_4G_MODE_ENABLED + subId, value);
        if (isNonTtyOrTtyOnVolteEnabledForSlot()) { //不支持TTY或者VoLTE支持TTY
            try {
                setAdvanced4GMode(enabled);//设置Votle
            } catch (ImsException ie) {
                // do nothing
            }
        }
    } 

以上代码是setEnhanced4gLteModeSettingForSlot的具体实现。代码不是很复杂,和android8.0之前版本的区别就在于它多了一个运载配置和getInt中subId的闯入。android8.0之前的版本好像是没有这两个东西的。
~
~
~

private void setAdvanced4GMode(boolean turnOn) throws ImsException {
        checkAndThrowExceptionIfServiceUnavailable();
        log("setAdvanced4GMode :: turnOn=" + turnOn);
        // if turnOn: first set feature values then call turnOnIms()
        // if turnOff: only set feature values if IMS turn off is not allowed. If turn off is
        // allowed, first call turnOffIms() then set feature values
        if (turnOn) {
            setLteFeatureValues(turnOn);
            log("setAdvanced4GMode: turnOnIms");
            turnOnIms();
        } else {
            if (isImsTurnOffAllowed()) {
                log("setAdvanced4GMode: turnOffIms");
                turnOffIms();
            }
           
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值