| | |
| | | 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")); |
| | |
| | | } else { |
| | | alarm.put("alarmLargePictureValid", "false"); |
| | | } |
| | | if (alarmTime < keepStartTime ) { |
| | | if (alarmTime < keepStartTime) { |
| | | alarm.put("canClose", "true"); |
| | | } else { |
| | | alarm.put("canClose", "false"); |
| | |
| | | } |
| | | 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 { |
| | |
| | | } |
| | | newAlarmIdSetLock.unlock(); |
| | | } |
| | | |
| | | public static boolean removeNewAlarmIdSet(Map<String, String> alarm) { |
| | | newAlarmIdSetLock.lock(); |
| | | boolean success = false; |
| | |
| | | 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++; |
| | |
| | | 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; |
| | | } |
| | |
| | | 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); |