From 86d0e7cbab56b83dce8de4d1545f2c61fcb35396 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 30 Mar 2017 12:07:36 +0200 Subject: [PATCH 1/3] Updated phone schemas to radar-android-phone dev branch --- common/phone/phone_battery_level.avsc | 4 +++- common/phone/phone_call.avsc | 13 +++++++++++++ common/phone/phone_location.avsc | 17 +++++++++++++++++ common/phone/phone_sms.avsc | 13 +++++++++++++ common/phone/phone_user_interaction.avsc | 11 +++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 common/phone/phone_call.avsc create mode 100644 common/phone/phone_location.avsc create mode 100644 common/phone/phone_sms.avsc create mode 100644 common/phone/phone_user_interaction.avsc diff --git a/common/phone/phone_battery_level.avsc b/common/phone/phone_battery_level.avsc index 5973aebf..dec81bc3 100644 --- a/common/phone/phone_battery_level.avsc +++ b/common/phone/phone_battery_level.avsc @@ -6,6 +6,8 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "batteryLevel", "type": "float", "doc": "battery level from 0 to 1"} + {"name": "batteryLevel", "type": "float", "doc": "battery level from 0 to 1"}, + {"name": "isPlugged", "type": "boolean", "doc": "whether the phone is connected to a power source"}, + {"name": "status", "type": {"name": "BatteryStatus", "type": "enum", "symbols": ["UNKNOWN", "CHARGING", "DISCHARGING", "NOT_CHARGING", "FULL"]}, "doc": "Android battery states", "default": "UNKNOWN"} ] } diff --git a/common/phone/phone_call.avsc b/common/phone/phone_call.avsc new file mode 100644 index 00000000..1c7d1fc7 --- /dev/null +++ b/common/phone/phone_call.avsc @@ -0,0 +1,13 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneCall", + "doc": "Data from the log of received and made calls.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"}, + {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, + {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "Direction of phone call.", "default": "UNKNOWN"} + ] +} \ No newline at end of file diff --git a/common/phone/phone_location.avsc b/common/phone/phone_location.avsc new file mode 100644 index 00000000..3d09bf1c --- /dev/null +++ b/common/phone/phone_location.avsc @@ -0,0 +1,17 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneLocation", + "doc": "Data from the gps and network location providers.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "provider", "type": {"name": "LocationProvider", "type": "enum", "symbols": ["GPS", "NETWORK", "OTHER"]}, "doc": "Android provider of the location data."}, + {"name": "latitude", "type": "double", "doc": "from a random reference latitude", "default": "NaN"}, + {"name": "longitude", "type": "double", "doc": "from a random reference longitude", "default": "NaN"}, + {"name": "altitude", "type": "float", "doc": "height above the WGS 84 (m)", "default": "NaN"}, + {"name": "accuracy", "type": "float", "doc": "accuracy of location (m)", "default": "NaN"}, + {"name": "speed", "type": "float", "doc": "speed over ground (m/s)", "default": "NaN"}, + {"name": "bearing", "type": "float", "doc": "the horizontal direction of travel of this device (degrees)", "default": "NaN"} + ] +} \ No newline at end of file diff --git a/common/phone/phone_sms.avsc b/common/phone/phone_sms.avsc new file mode 100644 index 00000000..704e90f9 --- /dev/null +++ b/common/phone/phone_sms.avsc @@ -0,0 +1,13 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneSms", + "doc": "Data from log sent and received text messages.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the SMS. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, + {"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "Direction of the SMS.", "default": "UNKNOWN"}, + {"name": "length", "type": "int", "doc": "Number of characters in the message (-1 if unknown)", "default": -1} + ] +} \ No newline at end of file diff --git a/common/phone/phone_user_interaction.avsc b/common/phone/phone_user_interaction.avsc new file mode 100644 index 00000000..8cd052c2 --- /dev/null +++ b/common/phone/phone_user_interaction.avsc @@ -0,0 +1,11 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneUserInteraction", + "doc": "Logs change of user interaction state: when the phone is unlocked or set to standby.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "lockState", "type": {"name": "PhoneLockState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED"]}, "doc": "What lock state the phone has"} + ] +} \ No newline at end of file From 1cbd6f9beeb050dbd76300042ed351825fa5c590 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 30 Mar 2017 12:34:16 +0200 Subject: [PATCH 2/3] Updated phone sensor docs --- common/phone/phone_call.avsc | 2 +- common/phone/phone_location.avsc | 14 +++++++------- common/phone/phone_sms.avsc | 4 ++-- common/phone/phone_user_interaction.avsc | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/phone/phone_call.avsc b/common/phone/phone_call.avsc index 1c7d1fc7..c9e3fc60 100644 --- a/common/phone/phone_call.avsc +++ b/common/phone/phone_call.avsc @@ -8,6 +8,6 @@ {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, - {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "Direction of phone call.", "default": "UNKNOWN"} + {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"} ] } \ No newline at end of file diff --git a/common/phone/phone_location.avsc b/common/phone/phone_location.avsc index 3d09bf1c..49a94377 100644 --- a/common/phone/phone_location.avsc +++ b/common/phone/phone_location.avsc @@ -2,16 +2,16 @@ "namespace": "org.radarcns.phone", "type": "record", "name": "PhoneLocation", - "doc": "Data from the gps and network location providers.", + "doc": "Data from the gps and network location providers. The latitude and longitude are stated with an unspecified reference offset and can thus be treated as relative locations. They cannot be used to infer absolute location. This means accurate distances or angles between locations cannot be calculated since those depend on the absolute location.", "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "provider", "type": {"name": "LocationProvider", "type": "enum", "symbols": ["GPS", "NETWORK", "OTHER"]}, "doc": "Android provider of the location data."}, - {"name": "latitude", "type": "double", "doc": "from a random reference latitude", "default": "NaN"}, - {"name": "longitude", "type": "double", "doc": "from a random reference longitude", "default": "NaN"}, - {"name": "altitude", "type": "float", "doc": "height above the WGS 84 (m)", "default": "NaN"}, - {"name": "accuracy", "type": "float", "doc": "accuracy of location (m)", "default": "NaN"}, + {"name": "provider", "type": {"name": "LocationProvider", "type": "enum", "symbols": ["GPS", "NETWORK", "OTHER"]}, "doc": "Android provider of the location data"}, + {"name": "latitude", "type": "double", "doc": "relative latitude from an initial random reference latitude (degrees with range [-90, 90])", "default": "NaN"}, + {"name": "longitude", "type": "double", "doc": "relative longitude from an initial reference longitude (degrees with range [-180, 180])", "default": "NaN"}, + {"name": "altitude", "type": "float", "doc": "height above the WGS 84 reference ellipsoid (m)", "default": "NaN"}, + {"name": "accuracy", "type": "float", "doc": "The estimated horizontal accuracy of this location, radial (m). We define horizontal accuracy as the radius of 68% confidence. In other words, if you draw a circle centered at this location's latitude and longitude, and with a radius equal to the accuracy, then there is a 68% probability that the true location is inside the circle.", "default": "NaN"}, {"name": "speed", "type": "float", "doc": "speed over ground (m/s)", "default": "NaN"}, - {"name": "bearing", "type": "float", "doc": "the horizontal direction of travel of this device (degrees)", "default": "NaN"} + {"name": "bearing", "type": "float", "doc": "the horizontal direction of travel of this device (degrees with range (0, 360])", "default": "NaN"} ] } \ No newline at end of file diff --git a/common/phone/phone_sms.avsc b/common/phone/phone_sms.avsc index 704e90f9..ac5b7fb6 100644 --- a/common/phone/phone_sms.avsc +++ b/common/phone/phone_sms.avsc @@ -7,7 +7,7 @@ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the SMS. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, - {"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "Direction of the SMS.", "default": "UNKNOWN"}, - {"name": "length", "type": "int", "doc": "Number of characters in the message (-1 if unknown)", "default": -1} + {"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "direction of the SMS", "default": "UNKNOWN"}, + {"name": "length", "type": "int", "doc": "number of characters in the message (-1 if unknown)", "default": -1} ] } \ No newline at end of file diff --git a/common/phone/phone_user_interaction.avsc b/common/phone/phone_user_interaction.avsc index 8cd052c2..29f8c10d 100644 --- a/common/phone/phone_user_interaction.avsc +++ b/common/phone/phone_user_interaction.avsc @@ -6,6 +6,6 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "lockState", "type": {"name": "PhoneLockState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED"]}, "doc": "What lock state the phone has"} + {"name": "lockState", "type": {"name": "PhoneLockState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED"]}, "doc": "what lock state the phone has"} ] } \ No newline at end of file From f68e2a32e64e949bb71c5a15e1eb2f5a3e8ec2e2 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Mon, 3 Apr 2017 09:54:20 +0200 Subject: [PATCH 3/3] Explicitly make PhoneRelativeLocation for relative locations --- .../phone/{phone_location.avsc => phone_relative_location.avsc} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename common/phone/{phone_location.avsc => phone_relative_location.avsc} (98%) diff --git a/common/phone/phone_location.avsc b/common/phone/phone_relative_location.avsc similarity index 98% rename from common/phone/phone_location.avsc rename to common/phone/phone_relative_location.avsc index 49a94377..4136d3e2 100644 --- a/common/phone/phone_location.avsc +++ b/common/phone/phone_relative_location.avsc @@ -1,7 +1,7 @@ { "namespace": "org.radarcns.phone", "type": "record", - "name": "PhoneLocation", + "name": "PhoneRelativeLocation", "doc": "Data from the gps and network location providers. The latitude and longitude are stated with an unspecified reference offset and can thus be treated as relative locations. They cannot be used to infer absolute location. This means accurate distances or angles between locations cannot be calculated since those depend on the absolute location.", "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"},