-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":984,"versionName":"2110221046","enabled":true,"outputFile":"ICSer_V984_2110221046_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V984_2110221046_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":988,"versionName":"2110222005","enabled":true,"outputFile":"ICSer_V988_2110222005_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V988_2110222005_release.apk","properties":{}}]
\ No newline at end of file
import static com.enqualcomm.support.Constants.SERVICE_PKG_NAME;\r
\r
public class AlarmWakeUp {\r
- private static long lastAlarmTime;\r
- \r
- public static void isNeedWakeUpAlarm(Runtime runtime) {\r
- long l = SystemClock.elapsedRealtime();\r
-// int i = Config.getAlarmCycle(runtime.getContextProxy().context);\r
- int i = Config.getLocationCycle(runtime.getContextProxy().context);\r
- if (l - lastAlarmTime > ((i + 1) * 60 * 1000)) { //达到cycle时间则唤醒CoreService并发送定位消息\r
- ComponentName componentName = new ComponentName(SERVICE_PKG_NAME, SERVICE_CLS_NAME);\r
-// Intent intent = (new Intent(CoreService.ACTION_ALARM)).setComponent(componentName);\r
- Intent intent = (new Intent(Constants.ACTION_LOCATION_ALARM)).setComponent(componentName);\r
- (runtime.getContextProxy()).context.startService(intent);\r
-\r
- StringBuilder stringBuilder = new StringBuilder();\r
- stringBuilder.append("isNeedWakeUpAlarm currentTimeMillis=");\r
- stringBuilder.append(l);\r
- stringBuilder.append("---lastAlarmTime=");\r
- stringBuilder.append(lastAlarmTime);\r
- ICLogger.i("AlarmWakeUp "+ stringBuilder.toString());\r
- if (Config.LOG_TOFILE) ICLogger.logToFile( "alarmCycle", stringBuilder.toString());\r
- } \r
- }\r
- \r
- public static void setAlarmWakeUpTime() { lastAlarmTime = SystemClock.elapsedRealtime(); }\r
+ private static long lastAlarmTime;\r
+\r
+ public static void isNeedWakeUpAlarm(Runtime runtime) {\r
+ long l = SystemClock.elapsedRealtime();\r
+ int i = Config.getLocationCycle(runtime.getContextProxy().context);\r
+ if (l - lastAlarmTime > ((i + 1) * 60 * 1000)) { //达到cycle时间则唤醒CoreService并发送定位消息\r
+ ComponentName componentName = new ComponentName(SERVICE_PKG_NAME, SERVICE_CLS_NAME);\r
+ Intent intent = (new Intent(Constants.ACTION_LOCATION_ALARM)).setComponent(componentName);\r
+ (runtime.getContextProxy()).context.startService(intent);\r
+\r
+ StringBuilder stringBuilder = new StringBuilder();\r
+ stringBuilder.append("isNeedWakeUpAlarm currentTimeMillis=");\r
+ stringBuilder.append(l);\r
+ stringBuilder.append("---lastAlarmTime=");\r
+ stringBuilder.append(lastAlarmTime);\r
+ ICLogger.i("AlarmWakeUp " + stringBuilder.toString());\r
+ if (Config.LOG_TOFILE) {\r
+ ICLogger.logToFile("alarmCycle", stringBuilder.toString());\r
+ }\r
+ }\r
+ }\r
+\r
+ public static void setAlarmWakeUpTime() {\r
+ lastAlarmTime = SystemClock.elapsedRealtime();\r
+ }\r
}\r
\r
ICLogger.i("BP15 , 定位周期=" + time + "秒");
try {
Config.setLocationMode(runtime.getContextProxy().context, ICLocation.CUSTOM_MOD8_GPS);
- Config.setLocationCycle(runtime.getContextProxy().context, Integer.parseInt(time));
+ int timeInt = Integer.parseInt(time);
+ //add k.liang 不知道为啥,不设置定位周期的时候返回的是5,设置之后为300,坑
+ if(timeInt < 15){
+ timeInt = timeInt * 60;
+ }
+ Config.setLocationCycle(runtime.getContextProxy().context, timeInt);
runtime.getLocationInstance().setWorkingMod(Config.getLocationMode(runtime.getContextProxy().context));
runtime.getLocationInstance().setLocation_cycle(Config.getLocationCycle(runtime.getContextProxy().context));
//set AlarmCycle and trigger Location