telephony相关修改点

本文介绍了如何在Mediatek设备上删除漫游状态图标、禁用VoLTE功能、修改网络标识、APN配置,并详细说明了volte图标、信号显示和网络设置的修改过程。涉及到了Telephony、SystemUI、MtkSettings等组件和配置文件的修改技巧。
摘要由CSDN通过智能技术生成

1、删掉漫游状态在状态栏上的R图标

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
mMobileRoaming.setVisibility

参考文章:https://blog.csdn.net/jydzm/article/details/86301195

2、删掉设置里的volte通话菜单和状态栏的volte图标

设置里的volte通话菜单

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java
getAvailabilityStatus(){
		...
		//根据config_device_volte_available配置隐藏菜单
        final boolean config_device_volte_available = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_device_volte_available);
        if(DEBUG){
            Log.d(TAG, "config_device_volte_available: "+config_device_volte_available);
        }
        if(!config_device_volte_available){
            return CONDITIONALLY_UNAVAILABLE;
        }
        ...
}

状态栏volte图标

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
setVolteIcon(){
	...
	final boolean config_device_volte_available = getResources().getBoolean(
                com.android.internal.R.bool.config_device_volte_available);
    if (DEBUG) {
        Log.d(TAG, "config_device_volte_available: " + config_device_volte_available + " volteIcon: " + volteIcon);
    }
    if(!config_device_volte_available){
        mVolteType.setVisibility(View.GONE);
    }
	...
}

配置config_device_volte_available的地方:
根据mccmnc配置具体的某个运营商是否支持,如果没有则添加对应的xml文件

device/mediatek/system/common/overlay/telephony/frameworks/base/core/res/res/values-mcc202-mnc01/config.xml
<bool translatable="false" name="config_device_volte_available">false</bool>

3、volte功能关闭

vendor/mediatek/proprietary/hardware/ril/fusion/libcarrierconfig/config_data/carrier_config_001_01.h
{ RFX_STATUS_KEY_CONFIG_DEVICE_VOLTE_AVAILABLE, "1"}, 1改为0

4、修改网络名称

根据具体的mccmnc修改对应名称

device/mediatek/common/spn-conf.xml
<spnOverride numeric="20810" spn="F SFR"/>

5、修改APN属性

根据具体的mccmnc修改对应名称,一般由客户提供具体的内容,添加某个运营商apn或者修改

device/mediatek/config/apns-conf.xml
<apn carrier="CMNET"
	mcc="460"
	mnc="02"
	apn="cmnet"
	type="default,supl,xcap,rcs"
	protocol="IPV4V6"
	roaming_protocol="IPV4V6"
    />

6、reset WLAN,Mobile&Blutooth 默认关闭漫游

vendor/mediatek/proprietary/packages/services/Telephony/src/com/android/phone/PhoneInterfaceManager.java
private boolean getDefaultDataRoamingEnabled(int subId) {
    final CarrierConfigManager configMgr = (CarrierConfigManager)
            mApp.getSystemService(Context.CARRIER_CONFIG_SERVICE);
    boolean isDataRoamingEnabled = TelephonyProperties.data_roaming().orElse(false);
    isDataRoamingEnabled |= configMgr.getConfigForSubId(subId).getBoolean(
            CarrierConfigManager.KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL);
    return isDataRoamingEnabled;
}

之前没找到TelephonyProperties.data_roaming()读取哪里的值。
后面找到了其实是系统属性,在device下面的mk文件中搜
ro.com.android.dataroaming
ro.com.android.mobiledata

7、MX, CH & PE open the default mobile data

默认打开某些国家的移动数据

vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
loadGlobalSettings(){
	...
	String countrycode = SystemProperties.get("ro.product.countrycode");
            if(mContext.getResources().getString(R.string.default_open_data_countrys).contains(countrycode)) {
               loadSetting(stmt, Settings.Global.DATA_ROAMING,1);
               loadSetting(stmt, Settings.Global.MOBILE_DATA,1);
               Log.d(TAG,"cyka 111: "+countrycode);
            } else {
               loadSetting(stmt, Settings.Global.DATA_ROAMING,0);
               loadSetting(stmt, Settings.Global.MOBILE_DATA,0);
                Log.d(TAG,"cyka 222: "+countrycode);
            }
	...
}

8、apn无法编辑

device/mediatek/config/apns-conf.xml
删掉dun
    <apn carrier="SFR Internet"
        carrier_id = "27"
        mcc="208"
        mnc="09"
        apn="websfr"
        type="default,dun"
    />

//代码逻辑

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/network/ApnEditor.java

String[] mReadOnlyApnTypes;
private final static String ITALY_VODAFONE_MCC_MNC = "20810";

onCreate(){
...
	// change edit for all apns of 20810
	//强制修改不可编辑,保存时也会根据mReadOnlyApnTypes检测是否可以保存,保存异常会有dialog
    String numeric = mTelephonyManager.getSimOperator(mSubId);
    Log.d(TAG, "onCreate, numeric=" + numeric);
    if (ITALY_VODAFONE_MCC_MNC.equals(numeric)){
        mReadOnlyApnTypes = getContext().getResources().getStringArray(
                R.array.read_only_apn_types_string_array);
        Log.i(TAG,"onCreate: read only APN type: " + Arrays.toString(mReadOnlyApnTypes)+" mApnData.getString(TYPE_INDEX): "+mApnData.getString(TYPE_INDEX));
    }
...
}

<string-array name="read_only_apn_types_string_array" num="0"/>

9、remove the state bar signal x

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
private SignalDrawable mMobileDrawable;//信号格图标

frameworks/base/packages/SettingsLib/src/com/android/settingslib/graph/SignalDrawable.java
//自己draw的,不是资源图片
public void draw(@NonNull Canvas canvas) {
	else if (isInState(STATE_CUT)) {
//            float cutX = (mCutoutWidthFraction * width / VIEWPORT);
//            float cutY = (mCutoutHeightFraction * height / VIEWPORT);
//            mCutoutPath.moveTo(width, height);
//            mCutoutPath.rLineTo(-cutX, 0);
//            mCutoutPath.rLineTo(0, -cutY);
//            mCutoutPath.rLineTo(cutX, 0);
//            mCutoutPath.rLineTo(0, cutY);
//            canvas.drawPath(mCutoutPath, mTransparentPaint);
//            canvas.drawPath(mScaledXPath, mForegroundPaint);
    }
}

10、remove MobileType icon

状态栏显示大4G和小4G2个图标,要删掉一个

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
private ImageView mNetworkType;//大的4G图标
private ImageView mMobileType;//小的4G图标

11、Video call forwarding option in call setting

phone->settings->Calls->Call forwarding
界面显示video和voice2个菜单
//mtk vilte SS feature
https://online.mediatek.com/FAQ#/SW/FAQ21227

vendor/mediatek/proprietary/frameworks/opt/telephony-base/java/mediatek/telephony/MtkCarrierConfigManager.java
public static final String MTK_KEY_SUPPORT_VT_SS_BOOL = "mtk_support_vt_ss_bool";
 
//M: VT support for SS
sDefaults.putBoolean(MTK_KEY_SUPPORT_VT_SS_BOOL, false);

vendor/mediatek/proprietary/packages/apps/CarrierConfig/assets/carrier_config_405799.xml
添加<boolean name="mtk_support_vt_ss_bool" value="true" />,打开对应mccmnc的开关

另一种命名规则:carrier_config_carrierid_1961_Airtel.xml
carrierid对应一组mccmnc,对应表在
vendor/mediatek/proprietary/packages/providers/TelephonyProvider/assets/sdk29_carrier_id/carrier_list.textpbliru 
例如:
carrier_id {
  canonical_id: 1961
  carrier_name: "Airtel"
  carrier_attribute {
    mccmnc_tuple: "40402"
    mccmnc_tuple: "40403"
    mccmnc_tuple: "40410"
    ...
}

12、展讯 Android S telephony相关

CarrierConfig

运营商名称显示
packages/apps/CarrierConfig/res/xml/vendor_20201.xml

<carrier_config>
 <boolean name="carrier_name_override_bool" value="true"/>
 <string name="carrier_name_string">vodafone GR</string>//vodafone GR为修改的名称
</carrier_config>

ViLTE视频通话配置
packages/providers/TelephonyProvider/assets/latest_carrier_id/carrier_list.textpb

packages/apps/CarrierConfig/assets/carrier_config_carrier_config_carrierid_1662_PLAY.xml

<boolean name="carrier_vt_available_bool" value="true"/>

VoLTE 语音通话开关是否显示

<boolean name="hide_enhanced_4g_lte_bool"value="true"/>

WLAN calling开关是否显示

<boolean name="carrier_wfc_ims_available_bool" value="false" />

VoLTE 图标显示
/packages/apps/CarrierConfig/assets/carrier_config_carrierid_xxx_xxx.xml

<bool name="show_volte_icon" value=false/>

H/H+图标显示

非 onebinary 客户。

Android 平台通过“config_hspa_data_distinguishable”控制是否显示 H/H+,默认值为 false,即全显示
3G。可通过如下方法实现显示 H/H+1. 确认运营商 overlays 代码路径。
可参考以下路径找到 overlays 代码。
/vendor/sprd/carriers/ctcc/overlays
2. 在对应的配置文件路径 frameworks/base/packages/SystemUI/res-unisoc/values/config.xml 中修改标签。
<bool name="config_hspa_data_distinguishable">true</bool>

onebianry 客户。
展锐平台通过“hspa_data_distinguishable”随卡配置,默认为 false,均显示为 3G。可通过如下方法实现
显示 H/H+1. 确认运营商 CarrierConfig2. 在对应的配置文件添加配置开关。
在 packages/apps/CarrierConfig/assets/carrier_config_carrierid_xxx_xxx.xml 中修改标签。
<boolean name=” hspa_data_distinguishable” value=true/>

紧急号码配置
sprd/platform/packages/apps/UniTelephony
修改txt文件,运行脚本更新data文件

uniecc/input/eccdata.txt
uniecc/output/unieccdata

mtk 紧急号码路径
vendor\mediatek\proprietary\external\EccList\ecc_list.xml

APN配置文件

vendor/sprd/telephony-res/apn/apns-conf_8.xml
vendor/sprd/telephony-res/apn/apns-conf_8_v2.xml
小结

telephony相关的问题分析步骤
telephony相关的问题,多和上层显示关联在一起。
比如systemui状态栏显示、setting里的网络和apn显示等等,显示逻辑都在上层app中。
配置参数在telephony相关的模块。

1、从log中找到mccmnc
2、在packages/providers/TelephonyProvider/assets/latest_carrier_id/carrier_list.textpb中查询mccmnc对应的canonical_id
3、找到上层app显示逻辑判断的值
4、在对应的xml中添加配置。packages/apps/CarrierConfig/assets/carrier_config_carrier_config_carrierid_1662_PLAY.xml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值