1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.health.connect; 18 19 import android.annotation.IntDef; 20 import android.annotation.SystemApi; 21 import android.health.connect.datatypes.ActiveCaloriesBurnedRecord; 22 import android.health.connect.datatypes.BasalMetabolicRateRecord; 23 import android.health.connect.datatypes.DistanceRecord; 24 import android.health.connect.datatypes.ElevationGainedRecord; 25 import android.health.connect.datatypes.HeartRateRecord; 26 import android.health.connect.datatypes.PowerRecord; 27 import android.health.connect.datatypes.Record; 28 import android.health.connect.datatypes.SpeedRecord; 29 import android.health.connect.datatypes.StepsRecord; 30 31 import java.lang.annotation.Retention; 32 import java.lang.annotation.RetentionPolicy; 33 34 /** 35 * Represents the permission category of a {@link Record}. A record can only belong to one and only 36 * one {@link HealthPermissionCategory} 37 * 38 * @hide 39 */ 40 @SystemApi 41 public class HealthPermissionCategory { 42 public static final int UNKNOWN = 0; 43 // ACTIVITY 44 /** Permission category for {@link ActiveCaloriesBurnedRecord} */ 45 public static final int ACTIVE_CALORIES_BURNED = 1; 46 /** Permission category for {@link DistanceRecord} */ 47 public static final int DISTANCE = 2; 48 /** Permission category for {@link ElevationGainedRecord} */ 49 public static final int ELEVATION_GAINED = 3; 50 /** 51 * Permission category for {@link android.health.connect.datatypes.ExerciseSessionRecord} and 52 * {@link android.health.connect.datatypes.ExerciseLap} 53 */ 54 public static final int EXERCISE = 4; 55 56 /** Permission category for {FloorsClimbedRecord} */ 57 public static final int FLOORS_CLIMBED = 5; 58 59 /** Permission category for {@link StepsRecord} */ 60 public static final int STEPS = 6; 61 // BODY_MEASUREMENTS 62 /** Permission category for {@link BasalMetabolicRateRecord} */ 63 public static final int BASAL_METABOLIC_RATE = 9; 64 /** Permission category for {BodyFatRecord} */ 65 public static final int BODY_FAT = 10; 66 /** Permission category for {BodyWaterMassRecord} */ 67 public static final int BODY_WATER_MASS = 11; 68 69 /** Permission category for {BoneMassRecord} */ 70 public static final int BONE_MASS = 12; 71 /** Permission category for {HeightRecord} */ 72 public static final int HEIGHT = 13; 73 /** Permission category for {LeanBodyMassRecord} */ 74 public static final int LEAN_BODY_MASS = 15; 75 /** Permission category for {@link PowerRecord} */ 76 public static final int POWER = 36; 77 /** Permission category for {@link SpeedRecord} */ 78 public static final int SPEED = 37; 79 /** Permission category for {TotalCaloriesBurnedRecord} */ 80 public static final int TOTAL_CALORIES_BURNED = 35; 81 /** Permission category for {Vo2MaxRecord} */ 82 public static final int VO2_MAX = 7; 83 /** Permission category for {WeightRecord} */ 84 public static final int WEIGHT = 17; 85 /** Permission category for {WheelChairPushesRecord} */ 86 public static final int WHEELCHAIR_PUSHES = 8; 87 // CYCLE_TRACKING 88 /** Permission category for {CervicalMucusRecord} */ 89 public static final int CERVICAL_MUCUS = 18; 90 /** Permission category for {IntermenstrualBleedingRecord} */ 91 public static final int INTERMENSTRUAL_BLEEDING = 38; 92 /** Permission category for {MenstruationRecord} */ 93 public static final int MENSTRUATION = 20; 94 /** Permission category for {OvulationTestRecord} */ 95 public static final int OVULATION_TEST = 21; 96 /** Permission category for {SexualActivityRecord} */ 97 public static final int SEXUAL_ACTIVITY = 22; 98 // NUTRITION 99 /** Permission category for {HydrationRecord} */ 100 public static final int HYDRATION = 23; 101 /** Permission category for {NutritionRecord} */ 102 public static final int NUTRITION = 24; 103 // SLEEP 104 /** Permission category for {BasalBodyTemperatureRecord} */ 105 public static final int BASAL_BODY_TEMPERATURE = 33; 106 /** Permission category for {SleepRecord} */ 107 public static final int SLEEP = 25; 108 // VITALS 109 /** Permission category for {BloodGlucose} */ 110 public static final int BLOOD_GLUCOSE = 26; 111 /** Permission category for {BloodPressure} */ 112 public static final int BLOOD_PRESSURE = 27; 113 /** Permission category for {BodyTemperature} */ 114 public static final int BODY_TEMPERATURE = 28; 115 /** Permission category for {@link HeartRateRecord} */ 116 public static final int HEART_RATE = 29; 117 /** Permission category for {HeartRateVariability} */ 118 public static final int HEART_RATE_VARIABILITY = 30; 119 /** Permission category for {OxygenSaturation} */ 120 public static final int OXYGEN_SATURATION = 31; 121 /** Permission category for {RespiratoryRate} */ 122 public static final int RESPIRATORY_RATE = 32; 123 /** Permission category for {RestingHeartRate} */ 124 public static final int RESTING_HEART_RATE = 34; 125 HealthPermissionCategory()126 private HealthPermissionCategory() {} 127 128 /** @hide */ 129 @IntDef({ 130 UNKNOWN, 131 ACTIVE_CALORIES_BURNED, 132 DISTANCE, 133 ELEVATION_GAINED, 134 EXERCISE, 135 FLOORS_CLIMBED, 136 STEPS, 137 TOTAL_CALORIES_BURNED, 138 VO2_MAX, 139 WHEELCHAIR_PUSHES, 140 POWER, 141 SPEED, 142 BASAL_METABOLIC_RATE, 143 BODY_FAT, 144 BODY_WATER_MASS, 145 BONE_MASS, 146 HEIGHT, 147 LEAN_BODY_MASS, 148 WEIGHT, 149 CERVICAL_MUCUS, 150 MENSTRUATION, 151 OVULATION_TEST, 152 SEXUAL_ACTIVITY, 153 INTERMENSTRUAL_BLEEDING, 154 HYDRATION, 155 NUTRITION, 156 SLEEP, 157 BASAL_BODY_TEMPERATURE, 158 BLOOD_GLUCOSE, 159 BLOOD_PRESSURE, 160 BODY_TEMPERATURE, 161 HEART_RATE, 162 HEART_RATE_VARIABILITY, 163 OXYGEN_SATURATION, 164 RESPIRATORY_RATE, 165 RESTING_HEART_RATE 166 }) 167 @Retention(RetentionPolicy.SOURCE) 168 public @interface Type {} 169 } 170