1syntax = "proto3";
2
3package com.android.server.healthconnect.proto.backuprestore;
4
5option java_multiple_files = true;
6
7message BackupData {
8  Record record = 1;
9}
10
11message Record {
12  string uuid = 1;
13  optional string package_name = 2;
14  optional string app_name = 3;
15  int64 last_modified_time = 4;
16  optional string client_record_id = 5;
17  int64 client_record_version = 6;
18  optional string manufacturer = 7;
19  optional string model = 8;
20  int32 device_type = 9;
21  int32 recording_method = 10;
22
23  oneof SubRecord {
24    IntervalRecord interval_record = 100;
25    InstantRecord instant_record = 101;
26  }
27}
28
29message IntervalRecord {
30  int64 start_time = 1;
31  int32 start_zone_offset = 2;
32  int64 end_time = 3;
33  int32 end_zone_offset = 4;
34
35  oneof Data {
36    ActiveCaloriesBurned active_calories_burned = 101;
37    ActivityIntensity activity_intensity = 102;
38    CyclingPedalingCadence cycling_pedaling_cadence = 103;
39    Distance distance = 104;
40    ElevationGained elevation_gained = 105;
41    ExerciseSession exercise_session = 106;
42    FloorsClimbed floors_climbed = 107;
43    HeartRate heart_rate = 108;
44    Hydration hydration = 109;
45    MenstruationPeriod menstruation_period = 110;
46    MindfulnessSession mindfulness_session = 111;
47    Nutrition nutrition = 112;
48    PlannedExerciseSession planned_exercise_session = 113;
49    Power power = 114;
50    SkinTemperature skin_temperature = 115;
51    SleepSession sleep_session = 116;
52    Speed speed = 117;
53    Steps steps = 100;
54    StepsCadence steps_cadence = 118;
55    TotalCaloriesBurned total_calories_burned = 119;
56    WheelchairPushes wheelchair_pushes = 120;
57  }
58}
59
60message InstantRecord {
61  int64 time = 1;
62  int32 zone_offset = 2;
63
64  oneof Data {
65    BasalBodyTemperature basal_body_temperature = 101;
66    BasalMetabolicRate basal_metabolic_rate = 102;
67    BloodGlucose blood_glucose = 103;
68    BloodPressure blood_pressure = 100;
69    BodyFat body_fat = 104;
70    BodyTemperature body_temperature = 105;
71    BodyWaterMass body_water_mass = 106;
72    BoneMass bone_mass = 107;
73    CervicalMucus cervical_mucus = 108;
74    HeartRateVariabilityRmssd heart_rate_variability_rmssd = 109;
75    Height height = 110;
76    IntermenstrualBleeding intermenstrual_bleeding = 111;
77    LeanBodyMass lean_body_mass = 112;
78    MenstruationFlow menstruation_flow = 113;
79    OvulationTest ovulation_test = 114;
80    OxygenSaturation oxygen_saturation = 115;
81    RespiratoryRate respiratory_rate = 116;
82    RestingHeartRate resting_heart_rate = 117;
83    SexualActivity sexual_activity = 118;
84    Vo2Max vo2_max = 119;
85    Weight weight = 120;
86  }
87}
88
89message ActiveCaloriesBurned {
90  double energy = 1;
91}
92
93message ActivityIntensity {
94  int32 activity_intensity_type = 1;
95}
96
97message BasalBodyTemperature {
98  int32 measurement_location = 1;
99  double temperature = 2;
100}
101
102message BasalMetabolicRate {
103  double basal_metabolic_rate = 1;
104}
105
106message BloodGlucose {
107  int32 specimen_source = 1;
108  double level = 2;
109  int32 relation_to_meal = 3;
110  int32 meal_type = 4;
111}
112
113message BloodPressure {
114  int32 measurement_location = 1;
115  double systolic = 2;
116  double diastolic = 3;
117  int32 body_position = 4;
118}
119
120message BodyFat {
121  double percentage = 1;
122}
123
124message BodyTemperature {
125  int32 measurement_location = 1;
126  double temperature = 2;
127}
128
129message BodyWaterMass {
130  double body_water_mass = 1;
131}
132
133message BoneMass {
134  double mass = 1;
135}
136
137message CervicalMucus {
138  int32 sensation = 1;
139  int32 appearance = 2;
140}
141
142message CyclingPedalingCadence {
143  repeated CyclingPedalingCadenceSample sample = 1;
144
145  message CyclingPedalingCadenceSample {
146    double revolutions_per_minute = 1;
147    int64 epoch_millis = 2;
148  }
149}
150
151message Distance {
152  double distance = 1;
153}
154
155message ElevationGained {
156  double elevation = 1;
157}
158
159message ExerciseSession {
160  optional string notes = 1;
161  int32 exercise_type = 2;
162  optional string title = 3;
163  bool has_route = 4;
164  optional ExerciseRoute route = 5;
165  repeated ExerciseLap lap = 6;
166  repeated ExerciseSegment segment = 7;
167  optional string planned_exercise_session_id = 8;
168
169  message ExerciseRoute {
170    repeated Location route_location = 1;
171
172    message Location {
173      int64 time = 1;
174      double latitude = 2;
175      double longitude = 3;
176      double horizontal_accuracy = 4;
177      double vertical_accuracy = 5;
178      double altitude = 6;
179    }
180  }
181
182  message ExerciseLap {
183    int64 start_time = 1;
184    int64 end_time = 2;
185    double length = 3;
186  }
187
188  message ExerciseSegment {
189    int64 start_time = 1;
190    int64 end_time = 2;
191    int32 segment_type = 3;
192    int32 repetitions_count = 4;
193  }
194}
195
196message FloorsClimbed {
197  double floors = 1;
198}
199
200message HeartRate {
201  repeated HeartRateSample sample = 1;
202
203  message HeartRateSample {
204    int32 beats_per_minute = 1;
205    int64 epoch_millis = 2;
206  }
207}
208
209message HeartRateVariabilityRmssd {
210  double heart_rate_variability_millis = 1;
211}
212
213message Height {
214  double height = 1;
215}
216
217message Hydration {
218  double volume = 1;
219}
220
221message IntermenstrualBleeding {
222  // This record type contains no data.
223}
224
225message LeanBodyMass {
226  double mass = 1;
227}
228
229message MenstruationFlow {
230  int32 flow = 1;
231}
232
233message MenstruationPeriod {
234  // This record type contains no data.
235}
236
237message MindfulnessSession {
238  int32 mindfulness_session_type = 1;
239  optional string title = 2;
240  optional string notes = 3;
241}
242
243message Nutrition {
244  double unsaturated_fat = 1;
245  double potassium = 2;
246  double thiamin = 3;
247  int32 meal_type = 4;
248  double trans_fat = 5;
249  double manganese = 6;
250  double energy_from_fat = 7;
251  double caffeine = 8;
252  double dietary_fiber = 9;
253  double selenium = 10;
254  double vitamin_b6 = 11;
255  double protein = 12;
256  double chloride = 13;
257  double cholesterol = 14;
258  double copper = 15;
259  double iodine = 16;
260  double vitamin_b12 = 17;
261  double zinc = 18;
262  double riboflavin = 19;
263  double energy = 20;
264  double molybdenum = 21;
265  double phosphorus = 22;
266  double chromium = 23;
267  double total_fat = 24;
268  double calcium = 25;
269  double vitamin_c = 26;
270  double vitamin_e = 27;
271  double biotin = 28;
272  double vitamin_d = 29;
273  double niacin = 30;
274  double magnesium = 31;
275  double total_carbohydrate = 32;
276  double vitamin_k = 33;
277  double polyunsaturated_fat = 34;
278  double saturated_fat = 35;
279  double sodium = 36;
280  double folate = 37;
281  double monounsaturated_fat = 38;
282  double pantothenic_acid = 39;
283  optional string meal_name = 40;
284  double iron = 41;
285  double vitamin_a = 42;
286  double folic_acid = 43;
287  double sugar = 44;
288}
289
290message OvulationTest {
291  int32 result = 1;
292}
293
294message OxygenSaturation {
295  double percentage = 1;
296}
297
298message PlannedExerciseSession {
299  optional string notes = 1;
300  int32 exercise_type = 2;
301  optional string title = 3;
302  bool has_explicit_time = 4;
303  repeated PlannedExerciseBlock exercise_block = 5;
304  optional string completed_exercise_session_id = 6;
305
306  message PlannedExerciseBlock {
307    int32 repetitions = 1;
308    optional string description = 2;
309    repeated PlannedExerciseStep step = 3;
310
311    message PlannedExerciseStep {
312      int32 exercise_type = 1;
313      int32 exercise_category = 2;
314      optional string description = 3;
315      ExerciseCompletionGoal completion_goal = 4;
316      repeated ExercisePerformanceGoal performance_goal = 5;
317
318      message ExerciseCompletionGoal {
319        oneof goal {
320          DistanceGoal distance_goal = 1;
321          StepsGoal steps_goal = 2;
322          DurationGoal duration_goal = 3;
323          RepetitionsGoal repetitions_goal = 4;
324          TotalCaloriesBurnedGoal total_calories_burned_goal = 5;
325          ActiveCaloriesBurnedGoal active_calories_burned_goal = 6;
326          DistanceWithVariableRestGoal distance_with_variable_rest_goal = 7;
327          UnspecifiedGoal unspecified_goal = 8;
328          UnknownGoal unknown_goal = 9;
329        }
330
331        message DistanceGoal {
332          double distance = 1;
333        }
334
335        message StepsGoal {
336          int32 steps = 1;
337        }
338
339        message DurationGoal {
340          int64 duration = 1;
341        }
342
343        message RepetitionsGoal {
344          int32 repetitions = 1;
345        }
346
347        message TotalCaloriesBurnedGoal {
348          double total_calories = 1;
349        }
350
351        message ActiveCaloriesBurnedGoal {
352          double active_calories = 1;
353        }
354
355        message DistanceWithVariableRestGoal {
356          double distance = 1;
357          int64 duration = 2;
358        }
359
360        message UnspecifiedGoal {
361          // No fields to write.
362        }
363
364        message UnknownGoal {
365          // No fields to write.
366        }
367      }
368
369      message ExercisePerformanceGoal {
370        oneof goal {
371          PowerGoal power_goal = 1;
372          SpeedGoal speed_goal = 2;
373          CadenceGoal cadence_goal = 3;
374          HeartRateGoal heart_rate_goal = 4;
375          WeightGoal weight_goal = 5;
376          RateOfPerceivedExertionGoal rate_of_perceived_exertion_goal = 6;
377          AmrapGoal amrap_goal = 7;
378          UnknownGoal unknown_goal = 8;
379        }
380
381        message PowerGoal {
382          double min_power = 1;
383          double max_power = 2;
384        }
385
386        message SpeedGoal {
387          double min_speed = 1;
388          double max_speed = 2;
389        }
390
391        message CadenceGoal {
392          double min_rpm = 1;
393          double max_rpm = 2;
394        }
395
396        message HeartRateGoal {
397          int32 min_bpm = 1;
398          int32 max_bpm = 2;
399        }
400
401        message WeightGoal {
402          double mass = 1;
403        }
404
405        message RateOfPerceivedExertionGoal {
406          int32 rpe = 1;
407        }
408
409        message AmrapGoal {
410          // No fields to write.
411        }
412        message UnknownGoal {
413          // No fields to write.
414        }
415      }
416    }
417  }
418}
419
420message Power {
421  repeated PowerSample sample = 1;
422
423  message PowerSample {
424    double power = 1;
425    int64 epoch_millis = 2;
426  }
427}
428
429message RespiratoryRate {
430  double rate = 1;
431}
432
433message RestingHeartRate {
434  int32 beats_per_minute = 1;
435}
436
437message SexualActivity {
438  int32 protection_used = 1;
439}
440
441message SkinTemperature {
442  int32 measurement_location = 1;
443  double baseline = 2;
444  repeated SkinTemperatureDeltaSample sample = 3;
445
446  message SkinTemperatureDeltaSample {
447    double temperature_delta_in_celsius = 1;
448    int64 epoch_millis = 2;
449  }
450}
451
452message SleepSession {
453  optional string notes = 1;
454  optional string title = 2;
455  repeated SleepStage stage = 3;
456
457  message SleepStage {
458    int64 start_time = 1;
459    int64 end_time = 2;
460    int32 stage_type = 3;
461
462  }
463}
464
465message Speed {
466  repeated SpeedSample sample = 1;
467
468  message SpeedSample {
469    double speed = 1;
470    int64 epoch_millis = 2;
471  }
472}
473
474message Steps {
475  int32 count = 1;
476}
477
478message StepsCadence {
479  repeated StepsCadenceSample sample = 1;
480
481  message StepsCadenceSample {
482    double rate = 1;
483    int64 epoch_millis = 2;
484  }
485}
486
487message TotalCaloriesBurned {
488  double energy = 1;
489}
490
491message Vo2Max {
492  int32 measurement_method = 1;
493  double vo2_milliliters_per_minute_kilogram = 2;
494}
495
496message Weight {
497  double weight = 1;
498}
499
500message WheelchairPushes {
501  int32 count = 1;
502}
503