guardianproject / haven

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors
https://guardianproject.github.io/haven/
GNU General Public License v3.0
6.58k stars 728 forks source link

Event time, Haven's log perspective #327

Closed CameraCornet closed 5 years ago

CameraCornet commented 5 years ago

the Event object seems to be created only one time in the app? Triggered by the first alert, an Event object is created. And this seems to set forth the idea that an event started at that first time and it never changes. Example of a session, "HH:MM" times:

01:30 session created, Haven is 'active' 02:00 motion detected, Event object created based on alert 02:01 8 triggers with 8 picture images. Then the motion stops, no more triggers 04:15 motion detected, same Event object from 02:00 is used 04:16 5 triggers with 5 picture images. Then the motion stops, no more triggers

The log treats this all as of it is an event at 02:00 with a total of 13 detection events? or am I confused or otherwise missing something?

My thinking is that if the last known trigger object is more than 15 minutes old, create a fresh Event object. I also suggest considering that the log track the session active time, the 01:30 time in my example. As it could prove useful in a situation where a real safety incident was captured by Haven and it would help to have records as to when Haven was activated.

n8fr8 commented 5 years ago

It is created each time the MonitorService is created, which is when the UI is activated for monitoring. The MonitorService instance is destroyed when Haven is deactivated. This, mLastEvent is null again and a new instance is created when the first alert comes in.

n8fr8 commented 5 years ago

The persistence layer has been vastly improved in the current 0.2.0 beta 3+ releases, and addresses this issue.