PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
activity_insights.h File Reference
#include "activity_private.h"
#include <time.h>
#include <stdint.h>

Data Structures

struct  ActivityInsightMetricHistoryStats
 Statistics of a metric's history, used to decide whether an insight can trigger. More...
 

Enumerations

enum  PercentTier {
  PercentTier_AboveAverage = 0 , PercentTier_OnAverage , PercentTier_BelowAverage , PercentTier_Fail ,
  PercentTierCount
}
 How a value compares to the user's average. More...
 
enum  ActivityInsightType {
  ActivityInsightType_Unknown = 0 , ActivityInsightType_SleepReward , ActivityInsightType_ActivityReward , ActivityInsightType_SleepSummary ,
  ActivityInsightType_ActivitySummary , ActivityInsightType_Day1 , ActivityInsightType_Day4 , ActivityInsightType_Day10 ,
  ActivityInsightType_ActivitySessionSleep , ActivityInsightType_ActivitySessionNap , ActivityInsightType_ActivitySessionWalk , ActivityInsightType_ActivitySessionRun ,
  ActivityInsightType_ActivitySessionOpen
}
 Insight types, reported to analytics. More...
 
enum  ActivityInsightResponseType {
  ActivityInsightResponseTypePositive = 0 , ActivityInsightResponseTypeNeutral , ActivityInsightResponseTypeNegative , ActivityInsightResponseTypeClassified ,
  ActivityInsightResponseTypeMisclassified
}
 User responses to an insight, reported to analytics. More...
 
enum  ActivationDelayInsightType { ActivationDelayInsightType_Day1 , ActivationDelayInsightType_Day4 , ActivationDelayInsightType_Day10 , ActivationDelayInsightTypeCount }
 Insights sent a number of days after activation. More...
 

Functions

void activity_insights_recalculate_stats (void)
 Recalculate the metric history statistics.
 
void activity_insights_init (time_t now_utc)
 Initialize activity insights.
 
void activity_insights_process_sleep_data (time_t now_utc)
 Process updated sleep metrics.
 
void activity_insights_process_minute_data (time_t now_utc)
 Check the step insights.
 
void activity_insights_push_activity_session_notification (time_t notif_time, ActivitySession *session, int32_t avg_hr, int32_t *hr_zone_time_s)
 Push the notification summarizing a walk, run or open workout session.
 
void activity_insights_test_push_summary_pins (void)
 Push the 3 variants of each summary pin, with a notification for the last one (test apps).
 
void activity_insights_test_push_rewards (void)
 Push the sleep and activity rewards (test apps).
 
void activity_insights_test_push_walk_run_sessions (void)
 Push a run and a walk notification (test apps).
 
void activity_insights_test_push_nap_session (void)
 Push a nap pin and notification (test apps).