打开Wifi但是没连接上某个AP时也要 让statsubar上面显示图标
时间:10-02
整理:3721RD
点击:
[android Version]
6575/6577 Android V4.0
[DESCRIPTION]
默认情况下,如果当前手机只是打开了Wifi,并没有连上某个AP时,其statusbar上是不会有图标显
示的。
如果在此种情况下也要让其进行显示的话,需要对php?mod=tag&id=6090" target="_blank" class="relatedlink">Frameworks\base\packages\systemui下的
NetworkController.java(单卡项目)Or NetworkControllerGemini.java(双卡项目)进行修改,让
其mWifiEnabled为true,但mWifiConnected为false时也让其显示其图标
[SOLUTION]
1)双卡项目,将NetworkControllerGemini.java文件的refreshViews方法的的以下地方改成如下:
if (tempLastMobileVisible != tempMobileVisible
|| tempLastSIMBackground != tempSIMBackground
|| tempLastPhoneSignalIconId != tempPhoneSignalIconId
|| mLastDataDirectionOverlayIconId != combineDACtivityIconId
|| mLastWifiIconId != mWifiIconId
|| mLastWimaxIconId != mWimaxIconId
|| tempLastDataTypeIconId != tempDataTypeIconId )
{
Xlog.d(TAG, "refreshViews(" + slotId + "), set parameters to signal
cluster view.");
// NB: the mLast*s will be updated later
for (SignalCluster cluster : mSignalClusters) {
if(mWifiEnabled&&!mWifiConnected){
cluster.setWifiIndicators(
true,
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);
}else{
cluster.setWifiIndicators(
mWifiConnected, // only show wifi in the cluster if connected
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);
}
if (tempSIMBackground > 0) {
cluster.setSIMBackground(slotId, tempSIMBackground);
}
2)单卡项目,将NetworkController.java文件的refreshSignalCluster方法的最开始处改成如下:
if(mWifiEnabled &&!mWifiConnected){
cluster.setWifiIndicators(
true,
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);
}else{
cluster.setWifiIndicators(
mWifiConnected, // only show wifi in the cluster if connected
mWifiIconId,
mWifiActivityIconId,
mContentDescriptionWifi);
}
if (mIsWimaxEnabled && mWimaxConnected) {
// wimax is special
cluster.setMobileDataIndicators(
true,
mAlwaysShoWCDMARssi ? mPhoneSignalIconId : mWimaxIconId,
mMobileActivityIconId,
mDataTypeIconId,
mContentDescriptionWimax,
mContentDescriptionDataType);
}