Health Services on Wear OS uses the following distinct permissions:
READ_HEART_RATEfor reading heart rate information.ACTIVITY_RECOGNITIONACCESS_FINE_LOCATIONBODY_SENSORSon Wear OS 5.1 (API level 35) and lowerBODY_SENSORS_BACKGROUNDbetween Wear OS 4 (API level 33) and Wear OS 5.1 (API level 35), inclusive
Consult the following table to determine which permissions are necessary for your app, based on the types of fitness data that you want to present to users. Make sure to follow the basic principles for requesting permissions, including asking for permissions in context.
If your app targets API level 36 or higher, and if it uses
PassiveMonitoringClient to access body sensor information in the
background, request the READ_HEALTH_DATA_IN_BACKGROUND permission.
If your app targets an API level between 33 and 35 inclusive, request both the
BODY_SENSORS and BODY_SENSORS_BACKGROUND permissions instead.
| Data type | Permission |
|---|---|
CALORIES CALORIES_DAILY DISTANCE_DAILY DECLINE_DISTANCE DISTANCE ELEVATION_GAIN ELEVATION_LOSS FLAT_GROUND_DISTANCE FLOORS FLOORS_DAILY GOLF_SHOT_COUNT INCLINE_DISTANCE PACE REP_COUNT RUNNING_STEPS SPEED STEPS STEPS_DAILY STEPS_PER_MINUTE SWIMMING_LAP_COUNT SWIMMING_STROKES CALORIES_TOTAL WALKING_STEPS UserActivityInfo UserActivityState |
ACTIVITY_RECOGNITION
|
HEART_RATE_BPM |
READ_HEART_RATE |
ABSOLUTE_ELEVATION LOCATION |
ACCESS_FINE_LOCATION
|
Migrate to support API level 36
If your app targets Wear OS 6 (API level 36) or higher, follow these steps to migrate your app to supporting the latest versions of the Wear OS platform:
In your manifest file, add the
maxSdkVersionfor the legacy permission, as well as the modernREAD_HEART_RATEpermission:<uses-permission android:name="android.permission.BODY_SENSORS" android:maxSdkVersion="35" /> <uses-permission android:name="android.permission.health.READ_HEART_RATE" />If your app requires access to body sensors while running in the background, add the
maxSdkVersionfor the legacy background permission, and add the modernREAD_HEALTH_DATA_IN_BACKGROUNDpermission:<uses-permission android:name="android.permission.BODY_SENSORS_BACKGROUND" android:maxSdkVersion="35" /> <uses-permission android:name="android.permission.health.READ_HEALTH_DATA_IN_BACKGROUND" />Request and confirm that the heart rate permission is granted everywhere your app checks for the
BODY_SENSORandBODY_SENSORS_BACKGROUNDpermission, filtering by Wear OS version. For example:if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) { this.add(HealthPermissions.READ_HEART_RATE) }