Refactor the mechanism to run the service regularly

Move all tracking logic from HarvestService to a new HarvestWatcher
class. This new class will also handle the run-regularly logic. To
do this, the new class implements the Runnable interface and uses
the Handler class.

Remove all AlarmManager related code, as explained adove, this is
replace by the new class. This is change is due the fact that this
Alarm approach, did not let the device go sleep.

Improve logging messages specifying which class it belongs to, to
improve debugging clarity.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Retrieve and anonymize UID

Use android BUILD api to get the device serial number,
and then anonymize this number by hashing it with SHA1
algorithm.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Log all in-memory registers for debugging

Niraj reported that after suspend-resume operations,
repeated entries were created in the DB. Therefore, I
am adding this to verify that the TaskInfo.id are not
changed.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Ignore Android tasks

Create a list of Android's system-level tasks, so we can
exclude them from the time tracking logic.

Refactor HarvestJournal.store code to separate the store
logic form the dump logic, so we can still dump even though
the task is in the blacklist.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Empty persisted data after successful report

Make sure we don't store time entries more than what
is really necessary. This will save a lot of space in
the long term.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>