Skip to content

Commit

Permalink
Support the new google play motion activity format
Browse files Browse the repository at this point in the history
As part of the change to slim down the apk for android,
e-mission/e-mission-phone#46,
e-mission/e-mission-data-collection#116
we switched from google play version from 8.1.0 to 8.3.0, which is the version
that has separate jar files, at least in my install.

But this changed the motion activity format - the field names are now `zzaKM`
and `zzaKN` instead of `zzaEg` and `zzaEh`. So we change the formatter on the
server to handle this use case as well.

Note that we should really fix
e-mission/e-mission-data-collection#80
to stop running into this in the future
  • Loading branch information
shankari committed Jun 28, 2016
1 parent ba31882 commit c1b6005
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions emission/net/usercache/formatters/android/motion_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ def format(entry):
data = ad.AttrDict()
if 'agb' in entry.data:
data.type = ecwa.MotionTypes(entry.data.agb).value
else:
elif 'zzaEg' in entry.data:
data.type = ecwa.MotionTypes(entry.data.zzaEg).value
else:
data.type = ecwa.MotionTypes(entry.data.zzaKM).value


if 'agc' in entry.data:
data.confidence = entry.data.agc
else:
elif 'zzaEh' in entry.data:
data.confidence = entry.data.zzaEh
else:
data.confidence = entry.data.zzaKN

data.ts = formatted_entry.metadata.write_ts
data.local_dt = formatted_entry.metadata.write_local_dt
Expand Down

0 comments on commit c1b6005

Please sign in to comment.