zhangzengfei
2020-07-30 512cae0fd797fac428f07d9d955f880e9ee353c1
app/src/main/java/com/basic/security/manager/AlarmManager.java
@@ -76,9 +76,9 @@
            if (sdkType != null) {
                apiModel.put("alarmType", apiModel.remove("sdkType"));
                if (sdkType.equals("人脸")) {
                    apiModel.put("property", apiModel.get("gender") + " " + apiModel.get("ageDescription") + " " + apiModel.get("race"));
                    apiModel.put("alarmPerson",
                            apiModel.remove("tableName")+" "+               apiModel.remove("idcard"));
//                    apiModel.put("property", apiModel.get("gender") + " " + apiModel.get("ageDescription") + " " + apiModel.get("race"));
                    apiModel.put("property", apiModel.remove("showLabels"));
                    apiModel.put("alarmPerson", apiModel.remove("tableName") + " " + apiModel.remove("idcard"));
                }
            }
            apiModel.put("alarmVideo", apiModel.get("videoNum"));
@@ -153,7 +153,7 @@
            } else {
                alarm.put("alarmLargePictureValid", "false");
            }
            if (alarmTime < keepStartTime ) {
            if (alarmTime < keepStartTime) {
                alarm.put("canClose", "true");
            } else {
                alarm.put("canClose", "false");
@@ -162,8 +162,10 @@
        }
        return sqliteAlarmList;
    }
    public static Set<String> newAlarmIdSet = new HashSet<>();
    public static Lock newAlarmIdSetLock = new ReentrantLock();
    public static void putNewAlarmIdSet(Map<String, String> newRemoteAlarm) {
        newAlarmIdSetLock.lock();
        try {
@@ -176,6 +178,7 @@
        }
        newAlarmIdSetLock.unlock();
    }
    public static boolean removeNewAlarmIdSet(Map<String, String> alarm) {
        newAlarmIdSetLock.lock();
        boolean success = false;
@@ -203,7 +206,7 @@
                newRemoteAlarm.put("table", "alarm");
                newRemoteAlarm.put("closeAlarm", "false");
                newRemoteAlarm.put("mute", "false");
                newRemoteAlarm.put("createTime", new Date().getTime()+"");
                newRemoteAlarm.put("createTime", new Date().getTime() + "");
                save(newRemoteAlarm);
                putNewAlarmIdSet(newRemoteAlarm);
                savedCount++;
@@ -226,9 +229,11 @@
            e.printStackTrace();
        }
    }
    public static List<Map<String, String>> newSqliteAlarmListBackup = new ArrayList<>();
    public static void updateVideoUrl() {
        HomeFragment homeFragment = ((MainActivity)BaseApplication.getApplication().activity).fragment_home;
        HomeFragment homeFragment = ((MainActivity) BaseApplication.getApplication().activity).fragment_home;
        if (homeFragment == null) {
            return;
        }
@@ -276,7 +281,7 @@
            String id = alarm.get(Alarm.id);
            if (!TextUtils.isEmpty(id)) {
                if (state) {
                    System.out.println("AlarmManager.putAlarmPlaying " + state + " " +id + FrameUtil.getFrames());
                    System.out.println("AlarmManager.putAlarmPlaying " + state + " " + id + FrameUtil.getFrames());
                }
                alarmPlayingMapLock.lock();
                alarmPlayingMap.put(id, state ? Constants.TRUE : Constants.FALSE);