xuxiuxi
2017-07-28 3699eddecd1337710f2bf1e95dac3e9bb4b49574
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java
@@ -9,6 +9,8 @@
import cn.com.basic.face.discern.common.CommonVariables;
import cn.com.basic.face.fragment.DeviceFragment;
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;
@@ -20,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.service.sync.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";
@@ -147,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();