stringBuilder1.append(Integer.valueOf(str, 16));\r
stringBuilder1.append(",CELLID=");\r
stringBuilder1.append(Integer.valueOf(str1, 16));\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "LBS", stringBuilder1.toString());\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile( "LBS", stringBuilder1.toString());\r
}\r
}\r
}\r
StringBuilder stringBuilder2 = new StringBuilder();\r
stringBuilder2.append("broadcastReceiver alarmCycle action==");\r
stringBuilder2.append(param1Intent.getAction());\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", stringBuilder2.toString());\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile( "alarmCycle", stringBuilder2.toString());\r
StringBuilder stringBuilder1 = new StringBuilder();\r
stringBuilder1.append("时间变化");\r
stringBuilder1.append(param1Intent.getAction()+stringBuilder2.toString());\r
StringBuilder stringBuilder1 = new StringBuilder();\r
stringBuilder1.append("LOCATION_ALARM work mod=");\r
stringBuilder1.append(runtime.getLocationInstance().getWorkingMod());\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", stringBuilder1.toString());\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("alarmCycle", stringBuilder1.toString());\r
// this.locationClient.triggerLocationProcess();\r
\r
} else {\r
if (Constants.SLEEP_ALARM.equals(paramIntent.getAction())) {\r
ICLogger.i("SLEEP_ALARM");\r
is_allowed_in_sleep_mode = 1;\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", "SLEEP_ALARM alarmCycle");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("alarmCycle", "SLEEP_ALARM alarmCycle");\r
setSleepAlarm();\r
boolean bool = ((PowerManager)getSystemService(POWER_SERVICE)).isScreenOn();\r
stringBuilder1 = new StringBuilder();\r
if (Constants.WAKE_ALARM.equals(paramIntent.getAction())) {\r
if (is_in_sleep_mode) {\r
is_in_sleep_mode = false;\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", "WAKE_ALARM alarmCycle");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("alarmCycle", "WAKE_ALARM alarmCycle");\r
if (this.mKeepAlive != null)\r
this.mKeepAlive.setSleepMode(false);\r
wakeUpFromSleep();\r
this.startConnectionRetryTimer();\r
}\r
setHeartAlarm();\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", "HEART_ALARM alarmCycle " );\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("alarmCycle", "HEART_ALARM alarmCycle " );\r
return Service.START_STICKY;\r
}\r
} else {\r
StringBuilder sb=new StringBuilder();\r
AlarmHelper.setRealTimeAlarm(runtime.getContextProxy().context,delayTimeInMinutes, ACTION_SEND_EMEGENCY_LOCATION_STOP);\r
sb.append(" tEmegencyLocationSTOPAlarm "+ACTION_SEND_EMEGENCY_LOCATION_STOP);\r
- ICLogger.i(sb.toString());\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(),"alarmCycle",sb.toString());\r
+// ICLogger.i(sb.toString());\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile("alarmCycle",sb.toString());\r
}\r
public void setLocationAlarm(int mod) {\r
// int mod=runtime.getLocationInstance().getWorkingMod();\r
// ICLogger.i("Nmea :"+nmeastr+" "+paramLong);\r
\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutputRaw(this.runtime.getCacheDir(), "Nmea", nmeastr);\r
+ ICLogger.logToFile("Nmea", nmeastr);\r
\r
if (nmeastr.startsWith("$RD_RSSI")) {\r
//每组NMEA数据的头,只适用于 SL8521E,9820E\r
}\r
sb.append("]");\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb.toString());\r
- ICLogger.i(sb.toString());\r
+ ICLogger.logToFile( "GPS", sb.toString());\r
\r
+ ICLogger.i(sb.toString());\r
// 卫星总数小于2 ,或者 snr小于20\r
if (runtime.getLocationInstance().numSatelliteList.size() < 3 && (runtime.getLocationInstance().max3Satellite.size() > 0 ? (runtime.getLocationInstance().max3Satellite.get(0).getSnr() < 20 ? true : false) : true)) {\r
noSignalCount++;\r
}\r
ICLogger.i(sb2.toString());\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb2.toString());\r
+ ICLogger.logToFile("GPS", sb2.toString());\r
\r
\r
if (mCallback != null)\r
latitude = last;\r
\r
// 经纬度 保留4位小数点\r
- DecimalFormat df = new DecimalFormat("#.000000");\r
+ DecimalFormat df = new DecimalFormat("#.0000000");\r
String strLatitude = df.format(latitude);\r
String strLongitude = df.format(longitude);\r
\r
sb.append("GPGGA, location time= " + TimeUtil.getLocalTime() + ", FixedCount=" + locationFixedCount + ", GPSTime=" + utctime + ", Lat=" + Lat + " (" + strLatitude + "), Lon=" + lon + " (" + strLongitude + "), fixed=" + fixed + ", hdop=" + hdop + ", usedStarts=" + usedStarts);\r
ICLogger.i(sb.toString());\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb.toString());\r
+ ICLogger.logToFile( "GPS", sb.toString());\r
//定位了,\r
if (hdop != null && hdop.trim().length() > 0 && Float.valueOf(hdop) < ICLocation.MAX_HDOP) {\r
locationFixedCount++;\r
} else {\r
ICLogger.i("HDOP is larger than " + ICLocation.MAX_HDOP + " , skip this location!");\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", "HDOP is larger than " + ICLocation.MAX_HDOP + " , skip this location!");\r
+ ICLogger.logToFile( "GPS", "HDOP is larger than " + ICLocation.MAX_HDOP + " , skip this location!");\r
}\r
if (locationFixedCount > MaxFixedTimes) {\r
/*\r
runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_FIXED);\r
ICLogger.i("定位" + locationFixedCount + "次 > " + MaxFixedTimes + ", set LOCATION_FIXED ");\r
if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", "定位" + locationFixedCount + "次 > " + MaxFixedTimes + ", set LOCATION_FIXED ");\r
+ ICLogger.logToFile("GPS", "定位" + locationFixedCount + "次 > " + MaxFixedTimes + ", set LOCATION_FIXED ");\r
if (!noStop) {\r
stopListen();\r
}\r
} else {\r
this.sortByLevel(aplist);\r
StringBuilder sb = new StringBuilder("");\r
+ StringBuilder sblog = new StringBuilder("");\r
Iterator it = aplist.iterator();\r
int count = 0;\r
\r
while (it.hasNext()) {\r
ScanResult var5 = (ScanResult) it.next();\r
if (var5.level != 0) {\r
- sb.append("&");\r
- sb.append("AP");\r
- sb.append(count);\r
- sb.append("|");\r
- sb.append(var5.BSSID);\r
- sb.append("|");\r
- sb.append(var5.level);\r
count ++;\r
- if (count == 6) {\r
- break;\r
+ if (count < 6) {\r
+ sb.append("&");\r
+ sb.append("AP");\r
+ sb.append(count);\r
+ sb.append("|");\r
+ sb.append(var5.BSSID);\r
+ sb.append("|");\r
+ sb.append(var5.level);\r
}\r
+ sblog.append("[").append(count).append(",SSID:").append(var5.SSID).append(",BSSID:").append(var5.BSSID).append(",Level:").append(var5.level).append("];");\r
}\r
}\r
if (sb.toString().startsWith("&")) sb.deleteCharAt(0);\r
- return sb;\r
+ if(Config.LOG_TOFILE) ICLogger.logToFile("LBS",sblog.toString());\r
+ return sb;\r
}\r
}\r
\r
ICLogger.i("网络不通,不能发送!");\r
if (!ServiceUtil.offerQueue(stringMessage,true)){\r
ICLogger.i("MessageQueue 已满,数据将被丢弃!"+ stringMessage);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(), "APILog", " queueFullskip! " + stringMessage);\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile( "APILog", " queueFullskip! " + stringMessage);\r
}\r
ret=false;\r
}\r
if(mRuntime.getUseQueue()){\r
if(!ServiceUtil.offerQueue(protocolAPIHelper.genStringMessage("queue",Msg))) {\r
ICLogger.i(" MessageQueue 已满,数据将被丢弃," + Msg);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(), "APILog", " queueFullskip " + Msg);\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile( "APILog", " queueFullskip " + Msg);\r
\r
}\r
\r
connection.send(protocolAPIHelper.genStringMessage("queue",Msg));\r
} else {\r
ICLogger.i("offline skip " + Msg);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(), "APILog", " offlineskip " + Msg);\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile( "APILog", " offlineskip " + Msg);\r
}\r
}\r
}\r
stringBuilder.append("---lastAlarmTime=");\r
stringBuilder.append(lastAlarmTime);\r
ICLogger.i("AlarmWakeUp "+ stringBuilder.toString());\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", stringBuilder.toString());\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile( "alarmCycle", stringBuilder.toString());\r
} \r
}\r
\r
int batteryVolt = param1Intent.getIntExtra(EXTRA_VOLTAGE, -1);\r
BatteryUtil.this.mRuntime.setBatteryVoltage(batteryVolt);\r
ICLogger.i("BatteryLevel "+i + " BatteryVotage "+batteryVolt);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"Battery","BatteryLevel "+i + " BatteryVotage "+batteryVolt);\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile("Battery","BatteryLevel "+i + " BatteryVotage "+batteryVolt);\r
if (i >= 100) {\r
Runtime runtime = BatteryUtil.this.mRuntime;\r
StringBuffer stringBuffer = BatteryUtil.this.mBuffer;\r
}else if (Intent.ACTION_BATTERY_LOW.equals(param1Intent.getAction())) {\r
BatteryUtil.this.mRuntime.setBatteryLow(true);\r
ICLogger.i("lowbattery finish video_end_call");\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"Battery","BatteryLow !");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow !");\r
\r
mRuntime.setAlarmType(false,mRuntime.getBatteryLow(),false,false);\r
//trigger AP10 报警定位\r
}else if (Intent.ACTION_BATTERY_OKAY.equals(param1Intent.getAction())){\r
\r
ICLogger.i("Battery OKAY !");\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"Battery","Battery OKAY !");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","Battery OKAY !");\r
\r
}else if (Intent.ACTION_POWER_CONNECTED.equals(param1Intent.getAction())){\r
ICLogger.i("ACTION_POWER_CONNECTED !");\r
mRuntime.setPowerConnected(true);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"Battery","ACTION_POWER_CONNECTED!");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","ACTION_POWER_CONNECTED!");\r
\r
}else if (Intent.ACTION_POWER_DISCONNECTED.equals(param1Intent.getAction())){\r
ICLogger.i("ACTION_POWER_DISCONNECTED!");\r
mRuntime.setPowerConnected(false);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"Battery","ACTION_POWER_DISCONNECTED !");\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","ACTION_POWER_DISCONNECTED !");\r
\r
}\r
}\r
// EqcAlgorithmNative.native_EqcAlgorithmMethod4(0, 0, CellInfoUtil.BSSS, CellInfoUtil.MCC, CellInfoUtil.MNC, CellInfoUtil.LAC, CellInfoUtil.CELL_ID);\r
mRuntime.cellinfo = mCellInfo;\r
}\r
- if (Config.LOG_TOFILE)FileOutputUtil.fileOutput(mRuntime.getCacheDir(),"LBS", mCellInfo);\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile("LBS", mCellInfo);\r
CellInfoUtil.releaseWakeLock(mWakeLock);\r
ICLogger.i(" setCurrentAttachCellInfo " + mCellInfo);\r
\r
Runtime runtime=CoreService.getInstance().getRuntime();\r
boolean ret=true;\r
ICLogger.i("handleCmd "+type.name() + " strLen="+cmd.length());\r
- if (Config.LOG_TOFILE)FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog", " recv " + cmd);\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile("APILog", " recv " + cmd);\r
switch (type){\r
case BP00:\r
API.handleBP00(cmd);\r
Runtime runtime=CoreService.getInstance().getRuntime();\r
boolean ret=true;\r
ICLogger.i("handleCmd "+type.name() + " "+cmd+" bytelen="+bytes.length );\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog", " recv " +new String(bytes));\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("APILog", " recv " +new String(bytes));\r
switch (type) {\r
case BP28:\r
API.handleBP28(NettyConnection.this,cmd, runtime,bytes);\r
if (!isServerConnected()){\r
\r
log("skiped"+cmd);\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog"," skiped " + cmd);\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("APILog"," skiped " + cmd);\r
return false;\r
}else{\r
log("send "+cmd);\r
}\r
);\r
\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog"," sent " + cmd);\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("APILog"," sent " + cmd);\r
\r
}\r
\r
if (!isServerConnected()){\r
\r
log("skipedBytes "+new String(cmdArray));\r
- if (Config.LOG_TOFILE)FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog"," skiped " + new String(cmdArray));\r
+ if (Config.LOG_TOFILE)ICLogger.logToFile("APILog"," skiped " + new String(cmdArray));\r
return false;\r
}else{\r
log("sendBytes "+new String(cmdArray));\r
}\r
);\r
\r
- if (Config.LOG_TOFILE) FileOutputUtil.fileOutput(CoreService.getInstance().getRuntime().getCacheDir(),"APILog"," sentBytes " + new String(cmdArray));\r
+ if (Config.LOG_TOFILE) ICLogger.logToFile("APILog"," sentBytes " + new String(cmdArray));\r
\r
}\r
\r