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