}\r
\r
public void startConnectionRetryTimer(){\r
- //联网再重试连接服务器\r
- if (SimSignalUtil.checkNet(runtime.getContextProxy().context) ) {\r
+ //联网再重试连接服务器, 不能够联网的情况下不管是不是有sim卡,以及是否联网,都进行重试,以便处理下面情况:\r
+ //1、sim卡接触不良,掉卡,可以尝试用此法恢复\r
+ //2、网络信号不好,造成临时掉线,但是恢复慢或不恢复,可以用此法尝试恢复\r
+// if (SimSignalUtil.checkNet(runtime.getContextProxy().context) ) {\r
stopConnectionRetryTimer();\r
if (mTimer_retry_connect == null) {\r
mTimer_retry_connect = new Timer();\r
}\r
}, 5000, 20000); //每次都是断网才需要重连,delay 5秒重连,并且每20秒重试一次\r
}\r
- }\r
+// }\r
}\r
\r
private static int no_network_Heartbeats_Count=0;\r
}\r
}else{\r
//没有网络就不用重新尝试连接网络了。网络连接后再重新尝试联网\r
- ICLogger.i("retry 没有网络就不用重新尝试连接网络了。网络连接后再重新尝试联网!");\r
+ ICLogger.i("retry "+no_network_Heartbeats_Count+" 没有网络就不用重新尝试连接网络了。网络连接后再重新尝试联网!");\r
no_network_Heartbeats_Count++;\r
stopConnectionRetryTimer();\r
}\r
if( no_network_Heartbeats_Count >10){\r
ICLogger.i("当前第"+no_network_Heartbeats_Count+"次心跳都没有连接服务器成功 > 10 ,重置SIM卡尝试重新注册网络!");\r
- SimSignalUtil.send_at_to_onoff_simcard(runtime);\r
+ SimSignalUtil.send_at_to_reset_simcard(runtime);\r
}\r
}\r
\r
btnSim.setOnClickListener(new View.OnClickListener() {\r
@Override\r
public void onClick(View view) {\r
- SimSignalUtil.send_at_to_onoff_simcard(CoreService.getInstance().runtime);\r
+ SimSignalUtil.send_at_to_reset_simcard(CoreService.getInstance().runtime);\r
Util.ShowToast(CoreService.getInstance().runtime,"Reset SimCard!");\r
}\r
});\r
\r
return lisScreenOn;\r
}\r
- public static void send_at_to_onoff_simcard(Runtime runtime){\r
+ public static void send_at_to_reset_simcard(Runtime runtime){\r
\r
Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");\r
intent.putExtra("command", "AT+SFUN=2"); //重新初始化sim卡\r
ICLogger.i("send_at_to_update_lbs ");\r
}\r
\r
- public static void send_at_to_reload_simcard(Runtime runtime){\r
-\r
- Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");\r
- intent.putExtra("command", "AT+SFUN=3"); //重新初始化sim卡\r
- intent.putExtra("arg2", "");\r
- ( runtime.getContextProxy()).context.sendBroadcast(intent);\r
- ICLogger.i("send_at_to_update_lbs ");\r
- }\r
public static void send_at_to_update_lbs(Runtime runtime) {\r
Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");\r
intent.putExtra("command", "AT+CREG=2");\r