1use serde::{Deserialize, Serialize};
6
7use crate::event::{
8 AppTransition, ExtensionCategory, FsActivityType, InteractionType, LocationType, NetworkType,
9 RingerMode, ScreenState, SemanticHint, SourceTier, TextHint,
10};
11
12#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
14pub struct SanitizedEvent {
15 pub event_id: String,
16 pub timestamp_ms: i64,
17 pub event_type: SanitizedEventType,
18 pub source_tier: SourceTier,
19 pub app_package: Option<String>,
20 pub uid: Option<u32>,
21}
22
23#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
24pub enum SanitizedEventType {
25 AppTransition {
27 package_name: String,
28 activity_class: Option<String>,
29 transition: AppTransition,
30 },
31 InterAppInteraction {
33 source_package: Option<String>,
34 target_service: String,
35 interaction_type: InteractionType,
36 },
37 Notification {
39 source_package: String,
40 category: Option<String>,
41 channel_id: Option<String>,
42 title_hint: TextHint,
43 text_hint: TextHint,
44 semantic_hints: Vec<SemanticHint>,
45 is_ongoing: bool,
46 group_key: Option<String>,
47 },
48 ProcessResource {
50 pid: u32,
51 package_name: Option<String>,
52 vm_rss_mb: u32,
53 vm_swap_mb: u32,
54 thread_count: u32,
55 oom_score: i32,
56 },
57 FileActivity {
59 package_name: Option<String>,
60 extension_category: ExtensionCategory,
61 activity_type: FsActivityType,
62 is_hot_file: bool,
63 },
64 Screen { state: ScreenState },
66 SystemStatus {
68 battery_pct: Option<u8>,
69 is_charging: bool,
70 network: NetworkType,
71 ringer_mode: RingerMode,
72 location_type: LocationType,
73 headphone_connected: bool,
74 },
75}