|
| 1 | +""" Module for raw feature phone usage """ |
| 2 | +from ..feature_types import raw_feature |
| 3 | + |
| 4 | +@raw_feature( |
| 5 | + name="com.apple.sensorkit.phone_usage", |
| 6 | + dependencies=["com.apple.sensorkit.phone_usage"] |
| 7 | +) |
| 8 | +def phone_usage(_limit=10000, |
| 9 | + cache=False, |
| 10 | + recursive=True, |
| 11 | + **kwargs): |
| 12 | + """ Get all phone usage data bounded by the time interval. |
| 13 | +
|
| 14 | + Args: |
| 15 | + _limit (int): The maximum number of sensor events to query for in a single request |
| 16 | + cache (bool): Indicates whether to save raw data locally in cache dir |
| 17 | + recursive (bool): if True, continue requesting data until all data is |
| 18 | + returned; else just one request |
| 19 | +
|
| 20 | + Returns: |
| 21 | + timestamp (int): The UTC timestamp for the accelerometer event. |
| 22 | + duration (int): The duration over which the report spans (seconds) |
| 23 | + totalUniqueContacts (int): Total number of unique contacts over the report span. |
| 24 | + totalIncomingCalls (int): Total number of incoming calls over the report span. |
| 25 | + totalOutgoingCalls (int): Total number of outgoing calls over the report span. |
| 26 | + totalPhoneCallDuration (float): Total phone call duration (seconds). |
| 27 | +
|
| 28 | + Example: |
| 29 | + [{'timestamp': 1666411200036, |
| 30 | + 'totalIncomingCalls': 0, |
| 31 | + 'totalOutgoingCalls': 4, |
| 32 | + 'duration': 86400, |
| 33 | + 'totalPhoneCallDuration': 39.51534700393677, |
| 34 | + 'totalUniqueContacts': 1}, |
| 35 | + {'timestamp': 1666411200033, |
| 36 | + 'totalPhoneCallDuration': 39.51534700393677, |
| 37 | + 'totalIncomingCalls': 0, |
| 38 | + 'duration': 86400, |
| 39 | + 'totalOutgoingCalls': 4, |
| 40 | + 'totalUniqueContacts': 1}, |
| 41 | + {'timestamp': 1666411200031, |
| 42 | + 'totalPhoneCallDuration': 39.51534700393677, |
| 43 | + 'totalUniqueContacts': 1, |
| 44 | + 'totalOutgoingCalls': 4, |
| 45 | + 'totalIncomingCalls': 0, |
| 46 | + 'duration': 86400}] |
| 47 | + """ |
| 48 | + return |
0 commit comments