定位到framework\com\android\internal\telephony\MMDataConnectionTracker.smali中
关键限制代码在isReadyForData()中
smali代码
if-eqz v3, :cond_eciget-boolean v6, p0, Lcom/android/internal/telephony/MMDataConnectionTracker;->isDataConnPopupAllowed:Zif-eqz v6, :cond_eciget-boolean v6, p0, Lcom/android/internal/telephony/MMDataConnectionTracker;->isDataConnDialogDisplayed:Zif-nez v6, :cond_ecsget-object v6, Lcom/android/internal/telephony/CommandsInterface$RadioTechnology;->RADIO_TECH_LTE:Lcom/android/internal/telephony/CommandsInterface$RadioTechnology;if-eq v4, v6, :cond_235invoke-virtual {p0}, Lcom/android/internal/telephony/MMDataConnectionTracker;->isRadioTechEvdo()Zmove-result v6if-eqz v6, :cond_262:cond_235iget-object v6, p0, Lcom/android/internal/telephony/MMDataConnectionTracker;->datalock:Ljava/lang/Object;monitor-enter v6:try_start_238const-string v7, "DATA"const-string v8, "[MMDataConnectionTracker] isReadyForData is True and isDataconnPopupAllowed is True "invoke-static {v7, v8}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)Iconst-string v7, "DATA"new-instance v8, Ljava/lang/StringBuilder;invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()Vconst-string v9, "data conn popup showed, "invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;move-result-object v8iget-boolean v9, p0, Lcom/android/internal/telephony/MMDataConnectionTracker;->isDataConnDialogDisplayed:Zinvoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;move-result-object v8invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;move-result-object v8invoke-static {v7, v8}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)Iinvoke-direct {p0}, Lcom/android/internal/telephony/MMDataConnectionTracker;->createDataConnectionDialog()Vmonitor-exit v6goto/16 :goto_ec:catchall_25fmove-exception v7monitor-exit v6:try_end_261.catchall {:try_start_238 .. :try_end_261} :catchall_25fthrow v7:cond_262const/4 v3, 0x0goto/16 :goto_ec
对应java代码
if (flag && isDataConnPopupAllowed && !isDataConnDialogDisplayed){int i4 = CommandsInterface.RadioTechnology.RADIO_TECH_LTE;if (i == i4 || isRadioTechEvdo())synchronized (datalock){int j4 = Log.d("DATA", "[MMDataConnectionTracker] isReadyForData is True and isDataconnPopupAllowed is True ");StringBuilder stringbuilder14 = (new StringBuilder()).append("data conn popup showed, ");boolean flag14 = isDataConnDialogDisplayed;String s4 = stringbuilder14.append(flag14).toString();int k4 = Log.e("DATA", s4);createDataConnectionDialog();}elseflag = false;}
可以看到
int i4 = CommandsInterface.RadioTechnology.RADIO_TECH_LTE;if (i == i4 || isRadioTechEvdo())
这个是关键判断,若非LTE或Evdo则flag=false;也就是不能上网
那么我们只需要去掉这个判断就可以了
也就是去掉这段对应smali代码
sget-object v6, Lcom/android/internal/telephony/CommandsInterface$RadioTechnology;->RADIO_TECH_LTE:Lcom/android/internal/telephony/CommandsInterface$RadioTechnology;if-eq v4, v6, :cond_235invoke-virtual {p0}, Lcom/android/internal/telephony/MMDataConnectionTracker;->isRadioTechEvdo()Zmove-result v6if-eqz v6, :cond_262
这样做之后,开机时便可看到弹出的是否使用数据的对话框了
7.13增加
启用设置中灰色的网络选项
修改Phone.apk\com\android\phone\Settings.smali
.method setEnabledAlwyasonMenu()V.locals 2.prologueconst-string v1, "alwayson_settings"invoke-direct {p0}, Lcom/android/phone/Settings;->isRoaming()Zmove-result v0if-eqz v0, :cond_0const-string v0, "alwayson_settings"invoke-virtual {p0, v1}, Lcom/android/phone/Settings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;move-result-object v0const/4 v1, 0x0invoke-virtual {v0, v1}, Landroid/preference/Preference;->setEnabled(Z)V:goto_0return-void:cond_0const-string v0, "alwayson_settings"invoke-virtual {p0, v1}, Lcom/android/phone/Settings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;move-result-object v0const/4 v1, 0x1invoke-virtual {v0, v1}, Landroid/preference/Preference;->setEnabled(Z)Vgoto :goto_0
.end methodH
将上面19行的0x0改为0x1即可
转载请注明出处:http://blog.csdn.net/su_ky/article/details/7740166