From 46a8044f3449c6e9a884c90477ada5a5e6879367 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期二, 01 八月 2017 17:37:39 +0800
Subject: [PATCH]
---
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java
index c8a4d1d..e207a66 100644
--- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java
+++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java
@@ -8,8 +8,9 @@
import cn.com.basic.face.base.MainActivity;
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.fragment.DeviceFragment;
-import cn.com.basic.face.service.sqlite.AttendanceDao;
import cn.com.basic.face.service.sqlite.DeviceDao;
+import cn.com.basic.face.service.sync.DeleteLastMonthRecordAndPictureThread;
+import cn.com.basic.face.service.sync.SyncDownThread;
import cn.com.basic.face.util.AppApi;
import org.xutils.http.RequestParams;
@@ -21,12 +22,14 @@
import cn.com.basic.face.discern.common.BaseCommonCallBack;
import cn.com.basic.face.discern.entity.Device;
import cn.com.basic.face.util.SharedPreferencesUtils;
-import cn.com.basic.face.util.SyncUpAndDownThread;
+import cn.com.basic.face.service.sync.SyncUpThread;
public class DeviceMng {
public static DeviceMng instance = new DeviceMng();
- private SyncUpAndDownThread syncUpAndDownThread = null;
+ private SyncUpThread syncUpThread = null;
+ private SyncDownThread syncDownThread = null;
+ private DeleteLastMonthRecordAndPictureThread deleteLastMonthRecordAndPictureThread = null;
public static String authorationId = "101";
@@ -67,6 +70,9 @@
// });
// return;
// }
+ if (MainActivity.getInstance().getInternetAccessible() == CommonVariables.InternetAccess.INTERNET_NOT_INITIALIZE) {
+ return;
+ }
if (BaseApplication.getInstance().networkAvailable()) {
RequestParams params = new RequestParams(AppApi.BASE_URL + AppApi.Query.DEVICE_QUERY);
@@ -145,10 +151,18 @@
}
});
synchronized (this) {
- if (syncUpAndDownThread == null) {
- syncUpAndDownThread = new SyncUpAndDownThread();
- syncUpAndDownThread.start();
- }
+ if (syncUpThread == null) {
+ syncUpThread = new SyncUpThread();
+ syncUpThread.start();
+ }
+ if (syncDownThread == null) {
+ syncDownThread = new SyncDownThread();
+ syncDownThread.start();
+ }
+ if (deleteLastMonthRecordAndPictureThread == null) {
+ deleteLastMonthRecordAndPictureThread = new DeleteLastMonthRecordAndPictureThread();
+ deleteLastMonthRecordAndPictureThread.start();
+ }
}
} else {
Toast.makeText(BaseApplication.getInstance(), "鏁版嵁搴撲腑鎵句笉鍒拌璁惧", Toast.LENGTH_SHORT).show();
--
Gitblit v1.8.0