微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > L版本网络状态发生切换时,状态栏没有出现搜网图标

L版本网络状态发生切换时,状态栏没有出现搜网图标

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
网络状态发生切换时,例如:当前网络是3G,在More->Mobile networks->Preferred network type中切换网络为 2G Only,发现状态栏网络类型图标还是显示3G,1秒后变成E。
正常情况应该是先出现掉网图标,接着出现搜网图标,最后显示新的网路类型图标。
[SOLUTION]
出现这种情况的原因是systemUI这边监听到service发生变化时(out of service),没有把之前的ServiceState以及一些数据清掉,解决办法如下:
当出现service change,且state为null时把之前的state重置。
alps\php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\policy\Networ
kControllerImpl.java
@Override
public void onServiceStateChanged(ServiceState state) {
if (DEBUG) {
Log.d(TAG, "PhoneStateListener:onServiceStateChanged, slot "
+ slotId + " before.");
Log.d(TAG, "PhoneStateListener:onServiceStateChanged voiceState="
+ state.getVoiceRegState() + " dataState=" + state.getDataRegState());
Log.d(TAG, "PhoneStateListener:onServiceStateChanged slot "
+ slotId
+ ", voiceNWType: " + state.getVoiceNetworkType()
+ ", dataNWType: " + state.getDataNetworkType());
}
///add this code begin
if(state.getVoiceRegState()==0&&state.getDataRegState()==0){
for (int i = 0; i < mSlotCount; i++) {
resetPhoneState(i);
}
}
///add this code end
if (isValidSlotId(slotId)) {
mServiceState[slotId] = state;
updateTelephonySignalStrength(slotId);
updateDataNetType(slotId);
updateDataIcon(slotId);
refreshViews(slotId);
/// M: Support "SystemUI - VoLTE icon".
updateVoLTE();
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top