• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package android.health.connect.aidl;
2 
3 import android.content.AttributionSource;
4 import android.health.connect.CreateMedicalDataSourceRequest;
5 import android.health.connect.DeleteMedicalResourcesRequest;
6 import android.health.connect.GetMedicalDataSourcesRequest;
7 import android.health.connect.MedicalResourceId;
8 import android.health.connect.UpsertMedicalResourceRequest;
9 import android.health.connect.aidl.ActivityDatesRequestParcel;
10 import android.health.connect.aidl.AggregateDataRequestParcel;
11 import android.health.connect.aidl.DeleteUsingFiltersRequestParcel;
12 import android.health.connect.aidl.IAccessLogsResponseCallback;
13 import android.health.connect.aidl.IActivityDatesResponseCallback;
14 import android.health.connect.aidl.IActivityDatesResponseCallback;
15 import android.health.connect.aidl.IAggregateRecordsResponseCallback;
16 import android.health.connect.aidl.IApplicationInfoResponseCallback;
17 import android.health.connect.aidl.IChangeLogsResponseCallback;
18 import android.health.connect.aidl.IDataStagingFinishedCallback;
19 import android.health.connect.aidl.IEmptyResponseCallback;
20 import android.health.connect.aidl.IEmptyResponseCallback;
21 import android.health.connect.aidl.IGetChangeLogTokenCallback;
22 import android.health.connect.aidl.IGetHealthConnectDataStateCallback;
23 import android.health.connect.aidl.IGetChangesForBackupResponseCallback;
24 import android.health.connect.aidl.IGetLatestMetadataForBackupResponseCallback;
25 import android.health.connect.aidl.IGetHealthConnectMigrationUiStateCallback;
26 import android.health.connect.aidl.IGetPriorityResponseCallback;
27 import android.health.connect.aidl.IInsertRecordsResponseCallback;
28 import android.health.connect.aidl.IMedicalDataSourceResponseCallback;
29 import android.health.connect.aidl.IMedicalDataSourcesResponseCallback;
30 import android.health.connect.aidl.ReadMedicalResourcesRequestParcel;
31 import android.health.connect.aidl.IMedicalResourcesResponseCallback;
32 import android.health.connect.aidl.IMedicalResourceListParcelResponseCallback;
33 import android.health.connect.aidl.IMedicalResourceTypeInfosCallback;
34 import android.health.connect.aidl.IMigrationCallback;
35 import android.health.connect.aidl.IReadMedicalResourcesResponseCallback;
36 import android.health.connect.aidl.IReadRecordsResponseCallback;
37 import android.health.connect.aidl.IRecordTypeInfoResponseCallback;
38 import android.health.connect.aidl.ReadRecordsRequestParcel;
39 import android.health.connect.aidl.RecordsParcel;
40 import android.health.connect.aidl.RecordsParcel;
41 import android.health.connect.aidl.ICanRestoreResponseCallback;
42 import android.health.connect.aidl.UpdatePriorityRequestParcel;
43 import android.health.connect.aidl.UpsertMedicalResourceRequestsParcel;
44 import android.health.connect.backuprestore.BackupMetadata;
45 import android.health.connect.changelog.ChangeLogTokenRequest;
46 import android.health.connect.changelog.ChangeLogsRequest;
47 import android.health.connect.datatypes.MedicalDataSource;
48 import android.health.connect.exportimport.IImportStatusCallback;
49 import android.health.connect.exportimport.IQueryDocumentProvidersCallback;
50 import android.health.connect.aidl.IEmptyResponseCallback;
51 import android.health.connect.exportimport.IScheduledExportStatusCallback;
52 import android.health.connect.exportimport.ScheduledExportSettings;
53 import android.health.connect.migration.MigrationEntity;
54 import android.health.connect.migration.MigrationEntityParcel;
55 import android.health.connect.restore.BackupFileNamesSet;
56 import android.health.connect.restore.StageRemoteDataRequest;
57 import android.health.connect.backuprestore.BackupChange;
58 import android.health.connect.backuprestore.RestoreChange;
59 import android.net.Uri;
60 import android.os.UserHandle;
61 
62 import java.util.List;
63 import java.util.Map;
64 
65 /**
66  * Interface for {@link com.android.health.connect.HealthConnectManager}
67  * {@hide}
68  */
69 interface IHealthConnectService {
grantHealthPermission(String packageName, String permissionName, in UserHandle user)70     void grantHealthPermission(String packageName, String permissionName, in UserHandle user);
revokeHealthPermission(String packageName, String permissionName, String reason, in UserHandle user)71     void revokeHealthPermission(String packageName, String permissionName, String reason, in UserHandle user);
revokeAllHealthPermissions(String packageName, String reason, in UserHandle user)72     void revokeAllHealthPermissions(String packageName, String reason, in UserHandle user);
getGrantedHealthPermissions(String packageName, in UserHandle user)73     List<String> getGrantedHealthPermissions(String packageName, in UserHandle user);
74 
75     /**
76      * Returns a Map<String, Integer> from a permission name to permission flags.
77      * @hide
78      */
getHealthPermissionsFlags(String packageName, in UserHandle user, in List<String> permissions)79     Map getHealthPermissionsFlags(String packageName, in UserHandle user, in List<String> permissions);
80 
81     /**
82      * @hide
83      */
setHealthPermissionsUserFixedFlagValue(String packageName, in UserHandle user, in List<String> permissions, boolean value)84     void setHealthPermissionsUserFixedFlagValue(String packageName, in UserHandle user, in List<String> permissions, boolean value);
85 
86     /* @hide */
getHistoricalAccessStartDateInMilliseconds(String packageName, in UserHandle user)87     long getHistoricalAccessStartDateInMilliseconds(String packageName, in UserHandle user);
88 
89     /**
90      * Inserts {@code records} into the HealthConnect database.
91      *
92      * @param attributionSource attribution source for the data.
93      * @param recordsParcel represents records to be inserted.
94      * @param callback Callback to receive result of performing this operation.
95      */
insertRecords( in AttributionSource attributionSource, in RecordsParcel recordsParcel, in IInsertRecordsResponseCallback callback)96     void insertRecords(
97         in AttributionSource attributionSource,
98         in RecordsParcel recordsParcel,
99         in IInsertRecordsResponseCallback callback);
100 
101     /**
102      * Returns aggregation results based on the {@code request} into the HealthConnect database.
103      *
104      * @param attributionSource attribution source for the data.
105      * @param request represents the request using which the aggregation is to be performed.
106      * @param callback Callback to receive result of performing this operation.
107      */
aggregateRecords( in AttributionSource attributionSource, in AggregateDataRequestParcel request, in IAggregateRecordsResponseCallback callback)108     void aggregateRecords(
109         in AttributionSource attributionSource,
110         in AggregateDataRequestParcel request,
111         in IAggregateRecordsResponseCallback callback);
112 
113     /**
114      * Reads from the HealthConnect database.
115      *
116      * @param attributionSource attribution source for the data.
117      * @param request represents the request to be read.
118      * @param callback Callback to receive result of performing this operation.
119      */
readRecords( in AttributionSource attributionSource, in ReadRecordsRequestParcel request, in IReadRecordsResponseCallback callback)120     void readRecords(
121         in AttributionSource attributionSource,
122         in ReadRecordsRequestParcel request,
123         in IReadRecordsResponseCallback callback);
124 
125     /**
126      * Updates {@param records} in the HealthConnect database.
127      *
128      * @param attributionSource attribution source for the data.
129      * @param recordsParcel represents records to be updated.
130      * @param callback Callback to receive result of performing this operation.
131      */
updateRecords( in AttributionSource attributionSource, in RecordsParcel recordsParcel, in IEmptyResponseCallback callback)132     void updateRecords(
133             in AttributionSource attributionSource,
134             in RecordsParcel recordsParcel,
135             in IEmptyResponseCallback callback);
136 
137     /**
138      * @param packageName calling package name
139      * @param request token request
140      * @return a token that can be used with {@code getChanges(token)} to fetch the upsert and
141      *     delete changes corresponding to {@code request}
142      */
getChangeLogToken( in AttributionSource attributionSource, in ChangeLogTokenRequest request, in IGetChangeLogTokenCallback callback)143     void getChangeLogToken(
144         in AttributionSource attributionSource,
145         in ChangeLogTokenRequest request,
146         in IGetChangeLogTokenCallback callback);
147 
148     /**
149      * @param attributionSource attribution source for the data.
150      * @param token request token from {@code getChangeLogToken}
151      */
getChangeLogs( in AttributionSource attributionSource, in ChangeLogsRequest token, in IChangeLogsResponseCallback callback)152     void getChangeLogs(
153         in AttributionSource attributionSource,
154         in ChangeLogsRequest token,
155         in IChangeLogsResponseCallback callback);
156 
157     /**
158      * @param attributionSource attribution source for the data.
159      * @param request Delete request using the mentioned filters
160      * @param callback Callback to receive result of performing this operation
161      */
deleteUsingFilters( in AttributionSource attributionSource, in DeleteUsingFiltersRequestParcel request, in IEmptyResponseCallback callback)162     void deleteUsingFilters(
163         in AttributionSource attributionSource,
164         in DeleteUsingFiltersRequestParcel request,
165         in IEmptyResponseCallback callback);
166 
167     /**
168      * @param permissionCategory PermissionCategory corresponding to which priority is requested
169      * @param callback Callback to receive result of performing this operation
170      */
getCurrentPriority( int permissionCategory, in IGetPriorityResponseCallback callback)171     void getCurrentPriority(
172         int permissionCategory,
173         in IGetPriorityResponseCallback callback);
174 
175     /**
176      * @param packageName Calling package's name
177      * @param request Update request with the required priority changes
178      * @param callback Callback to receive result of performing this operation
179      */
updatePriority( in UpdatePriorityRequestParcel request, in IEmptyResponseCallback callback)180     void updatePriority(
181         in UpdatePriorityRequestParcel request,
182         in IEmptyResponseCallback callback);
183 
184     /** Sets record rention period for HC DB */
setRecordRetentionPeriodInDays( int days, in UserHandle userHandle, in IEmptyResponseCallback callback)185     void setRecordRetentionPeriodInDays(
186         int days,
187         in UserHandle userHandle,
188         in IEmptyResponseCallback callback);
189 
190     /** Gets record rention period for HC DB */
getRecordRetentionPeriodInDays(in UserHandle userHandle)191     int getRecordRetentionPeriodInDays(in UserHandle userHandle);
192 
193     /**
194      * Returns information, represented by {@code ApplicationInfoResponse}, for all the
195      * packages that have contributed to the health connect DB.
196      *
197      * @param callback Callback to receive result of performing this operation.
198      */
getContributorApplicationsInfo(in IApplicationInfoResponseCallback callback)199     void getContributorApplicationsInfo(in IApplicationInfoResponseCallback callback);
200 
201     /** Returns information for each RecordType like health permission category, record category and
202      * contributing packages.
203      * @param callback Callback to receive result of performing this operation.
204      */
queryAllRecordTypesInfo(in IRecordTypeInfoResponseCallback callback)205     void queryAllRecordTypesInfo(in IRecordTypeInfoResponseCallback callback);
206 
207     /**
208      * @param packageName name of the package reading access logs
209      * @param callback Callback to receive result of performing this operation
210      */
queryAccessLogs( String packageName, in IAccessLogsResponseCallback callback)211     void queryAccessLogs(
212         String packageName,
213         in IAccessLogsResponseCallback callback);
214 
215     /**
216      * Returns a list of unique dates for which at least one record type has at least one entry.
217      *
218      * @param recordTypes List of record types classes for which to get the activity dates.
219      * @param callback Callback to receive the result of performing this operation.
220      * {@hide}
221      */
getActivityDates( in ActivityDatesRequestParcel recordTypes, in IActivityDatesResponseCallback callback)222     void getActivityDates(
223         in ActivityDatesRequestParcel recordTypes,
224         in IActivityDatesResponseCallback callback);
225 
226     /**
227      * Marks the start of the migration.
228      *
229      * @param packageName calling package name
230      * @param callback Callback to receive a result or an error encountered while performing this
231      * operation.
232      */
startMigration(String packageName, in IMigrationCallback callback)233     void startMigration(String packageName, in IMigrationCallback callback);
234 
235     /**
236      * Marks the end of the migration.
237      *
238      * @param packageName calling package name
239      * @param callback Callback to receive a result or an error encountered while performing this
240      * operation.
241      */
finishMigration(String packageName, in IMigrationCallback callback)242     void finishMigration(String packageName, in IMigrationCallback callback);
243 
244     /**
245      * Writes given entities to the module database.
246      *
247      * @param packageName calling package name
248      * @param entities List of {@link MigrationEntity} to migrate.
249      * @param callback Callback to receive a result or an error encountered while performing this
250      * operation.
251      */
writeMigrationData( String packageName, in MigrationEntityParcel parcel, in IMigrationCallback callback)252     void writeMigrationData(
253         String packageName,
254         in MigrationEntityParcel parcel,
255         in IMigrationCallback callback);
256 
257     /**
258      * @param packageName calling package name
259      * @param callback Callback to receive a result or an error encountered while performing this
260      * operation.
261      */
insertMinDataMigrationSdkExtensionVersion( String packageName, int requiredSdkExtension, in IMigrationCallback callback)262     void insertMinDataMigrationSdkExtensionVersion(
263         String packageName,
264         int requiredSdkExtension,
265         in IMigrationCallback callback);
266 
267     /**
268      * Stages all HealthConnect remote data and returns any errors in a callback. Errors encountered
269      * for all the files are shared in the provided callback.
270      *
271      * @param pfdsByFileName The map of file names and their {@link ParcelFileDescriptor}s.
272      * @param executor       The {@link Executor} on which to invoke the callback.
273      * @param callback       The callback which will receive the outcome of this call.
274      * @throws NullPointerException if null is passed for any of the required {@link NonNull}
275      *                              parameters.
276      * @hide
277      */
stageAllHealthConnectRemoteData(in StageRemoteDataRequest stageRemoteDataRequest, in UserHandle userHandle, in IDataStagingFinishedCallback callback)278     void stageAllHealthConnectRemoteData(in StageRemoteDataRequest stageRemoteDataRequest,
279             in UserHandle userHandle, in IDataStagingFinishedCallback callback);
280 
281     /**
282      * Copies all HealthConnect backup data in the passed FDs.
283      *
284      * <p>The shared data should later be sent for cloud backup or to another device for backup.
285      *
286      * <p>We are responsible for closing the original file descriptors. The caller must not close
287      * the FD before that.
288      *
289      * @param pfdsByFileName The map of file names and their {@link ParcelFileDescriptor}s.
290      * @hide
291      */
getAllDataForBackup(in StageRemoteDataRequest stageRemoteDataRequest, in UserHandle userHandle)292     void getAllDataForBackup(in StageRemoteDataRequest stageRemoteDataRequest, in UserHandle userHandle);
293 
294     /**
295      * Shares the names of all HealthConnect backup files
296      *
297      * @hide
298      */
getAllBackupFileNames(in boolean forDeviceToDevice)299     BackupFileNamesSet getAllBackupFileNames(in boolean forDeviceToDevice);
300 
301     /**
302      * Deletes all previously staged HealthConnect data from the disk.
303      * For testing purposes only.
304      *
305      * @hide
306      */
deleteAllStagedRemoteData(in UserHandle userHandle)307     void deleteAllStagedRemoteData(in UserHandle userHandle);
308 
309     /**
310      * Updates the download state of the Health Connect data.
311      *
312      * @param downloadState The download state which needs to be purely one of:
313      *                      {@link HealthConnectManager#CLOUD_DOWNLOAD_STARTED}, {@link
314      *                      HealthConnectManager#CLOUD_DOWNLOAD_RETRY}, {@link
315      *                      HealthConnectManager#CLOUD_DOWNLOAD_FAILED}, {@link
316      *                      HealthConnectManager#CLOUD_DOWNLOAD_COMPLETE}
317      * @hide
318      */
updateDataDownloadState(int downloadState)319      void updateDataDownloadState(int downloadState);
320 
321     /**
322      * Asynchronously returns the current state of the Health Connect data as it goes through the Data-Restore and/or the Data-Migration process.
323      *
324      * <p>See also {@link HealthConnectDataState} object describing the HealthConnect state.
325      *
326      * @param callback The callback which will receive the current {@link HealthConnectDataState}.
327      *
328      * @hide
329      */
getHealthConnectDataState(in IGetHealthConnectDataStateCallback callback)330     void getHealthConnectDataState(in IGetHealthConnectDataStateCallback callback);
331 
332     /**
333      * Asynchronously returns the current UI state of Health Connect as it goes through the Data-Migration process.
334      *
335      * <p>See also {@link HealthConnectMigrationUiState} object describing the HealthConnect UI state.
336      *
337      * @param callback The callback which will receive the current {@link HealthConnectMigrationUiState}.
338      *
339      * @hide
340      */
getHealthConnectMigrationUiState(in IGetHealthConnectMigrationUiStateCallback callback)341     void getHealthConnectMigrationUiState(in IGetHealthConnectMigrationUiStateCallback callback);
342 
343     /**
344     * Configures the settings for the scheduled export of Health Connect data.
345     *
346     * @param settings Settings to use for the scheduled export. Use null to clear the settings.
347     *
348     * @hide
349     */
configureScheduledExport(in @ullable ScheduledExportSettings settings, in UserHandle userHandle)350     void configureScheduledExport(in @nullable ScheduledExportSettings settings, in UserHandle userHandle);
351 
352     /**
353     * Gets the period in days between scheduled exports of Health Connect data.
354     *
355     * @hide
356     */
getScheduledExportPeriodInDays(in UserHandle userHandle)357     int getScheduledExportPeriodInDays(in UserHandle userHandle);
358 
359     /**
360     * Queries the document providers available to be used for export/import.
361     *
362     * @hide
363     */
queryDocumentProviders(in UserHandle userHandle, in IQueryDocumentProvidersCallback callback)364     void queryDocumentProviders(in UserHandle userHandle, in IQueryDocumentProvidersCallback callback);
365 
366     /**
367     * Gets the status of the currently scheduled export.
368     *
369     * @hide
370     */
getScheduledExportStatus(in UserHandle userHandle, in IScheduledExportStatusCallback callback)371     void getScheduledExportStatus(in UserHandle userHandle, in IScheduledExportStatusCallback callback);
372 
373     /**
374      * Allows setting lower rate limits in tests.
375      *
376      * @hide
377      */
setLowerRateLimitsForTesting(in boolean enabled)378     void setLowerRateLimitsForTesting(in boolean enabled);
379 
380     /**
381     * Gets the status of the ongoing data import.
382     *
383     * @hide
384     */
getImportStatus(in UserHandle userHandle, in IImportStatusCallback callback)385     void getImportStatus(in UserHandle userHandle, in IImportStatusCallback callback);
386 
387     /**
388     * Imports the given compressed database file.
389     *
390     * @hide
391     */
runImport(in UserHandle userHandle, in Uri file, in IEmptyResponseCallback callback)392     void runImport(in UserHandle userHandle, in Uri file, in IEmptyResponseCallback callback);
393 
394     /**
395     * Triggers an immediate export of health connect data.
396     *
397     * @hide
398     */
runImmediateExport(in Uri file, in IEmptyResponseCallback callback)399     void runImmediateExport(in Uri file, in IEmptyResponseCallback callback);
400 
401     /**
402      * Creates a {@code MedicalDataSource} in HealthConnect based on the {@code request} values.
403      *
404      * @param attributionSource attribution source for the data.
405      * @param request Creation request.
406      * @param callback Callback to receive result of performing this operation.
407      */
createMedicalDataSource( in AttributionSource attributionSource, in CreateMedicalDataSourceRequest request, in IMedicalDataSourceResponseCallback callback)408     void createMedicalDataSource(
409             in AttributionSource attributionSource,
410             in CreateMedicalDataSourceRequest request,
411             in IMedicalDataSourceResponseCallback callback);
412 
413     /**
414      * Gets {@code MedicalDataSource}s in HealthConnect matching the given ids.
415      *
416      * @param attributionSource attribution source for the data.
417      * @param ids the ids for which datasources to fetch.
418      * @param callback Callback to receive result of performing this operation.
419      */
getMedicalDataSourcesByIds( in AttributionSource attributionSource, in List<String> ids, in IMedicalDataSourcesResponseCallback callback)420     void getMedicalDataSourcesByIds(
421             in AttributionSource attributionSource,
422             in List<String> ids,
423             in IMedicalDataSourcesResponseCallback callback);
424 
425     /**
426      * Gets {@code MedicalDataSource}s in HealthConnect based on the {@code request} values.
427      *
428      * @param attributionSource attribution source for the data.
429      * @param request specification for which datasources to fetch.
430      * @param callback Callback to receive result of performing this operation.
431      */
getMedicalDataSourcesByRequest( in AttributionSource attributionSource, in GetMedicalDataSourcesRequest request, in IMedicalDataSourcesResponseCallback callback)432     void getMedicalDataSourcesByRequest(
433             in AttributionSource attributionSource,
434             in GetMedicalDataSourcesRequest request,
435             in IMedicalDataSourcesResponseCallback callback);
436 
437     /**
438      * Deletes a {@code MedicalDataSource} in HealthConnect including all the data contained in it.
439      *
440      * <p>If the datasource does not exist, the operation will fail.
441      *
442      * @param attributionSource attribution source for the data.
443      * @param id the datasource to delete, returned earlier from {@code createMedicalDataSource}
444      * @param callback Callback to receive result of performing this operation.
445      */
deleteMedicalDataSourceWithData( in AttributionSource attributionSource, in String id, in IEmptyResponseCallback callback)446     void deleteMedicalDataSourceWithData(
447             in AttributionSource attributionSource,
448             in String id,
449             in IEmptyResponseCallback callback);
450 
451     /**
452      * Upserts {@link MedicalResource}s in HealthConnect based on a list of {@link
453      * UpsertMedicalResourceRequest}s.
454      *
455      * @param attributionSource attribution source for the data.
456      * @param requests A list of upsert requests.
457      * @param callback Callback to receive result of performing this operation.
458      */
upsertMedicalResources( in AttributionSource attributionSource, in List<UpsertMedicalResourceRequest> requests, in IMedicalResourcesResponseCallback callback)459     void upsertMedicalResources(
460         in AttributionSource attributionSource,
461         in List<UpsertMedicalResourceRequest> requests,
462         in IMedicalResourcesResponseCallback callback);
463 
464     /**
465      * Upserts {@link MedicalResource}s in HealthConnect based on a {@link
466      * UpsertMedicalResourceRequestsParcel}.
467      *
468      * @param attributionSource attribution source for the data.
469      * @param requestsParcel Contains the list of upsert requests.
470      * @param callback Callback to receive result of performing this operation.
471      */
upsertMedicalResourcesFromRequestsParcel( in AttributionSource attributionSource, in UpsertMedicalResourceRequestsParcel requestsParcel, in IMedicalResourceListParcelResponseCallback callback)472     void upsertMedicalResourcesFromRequestsParcel(
473         in AttributionSource attributionSource,
474         in UpsertMedicalResourceRequestsParcel requestsParcel,
475         in IMedicalResourceListParcelResponseCallback callback);
476 
477     /**
478      * Reads from the HealthConnect database.
479      *
480      * @param attributionSource attribution source for the data.
481      * @param medicalResourceIds represents the ids to be read.
482      * @param callback Callback to receive result of performing this operation.
483      */
readMedicalResourcesByIds( in AttributionSource attributionSource, in List<MedicalResourceId> medicalResourceIds, in IReadMedicalResourcesResponseCallback callback)484     void readMedicalResourcesByIds(
485         in AttributionSource attributionSource,
486         in List<MedicalResourceId> medicalResourceIds,
487         in IReadMedicalResourcesResponseCallback callback);
488 
489     /**
490      * Reads from the HealthConnect database.
491      *
492      * @param attributionSource attribution source for the data.
493      * @param request Read request.
494      * @param callback Callback to receive result of performing this operation.
495      */
readMedicalResourcesByRequest( in AttributionSource attributionSource, in ReadMedicalResourcesRequestParcel request, in IReadMedicalResourcesResponseCallback callback)496     void readMedicalResourcesByRequest(
497         in AttributionSource attributionSource,
498         in ReadMedicalResourcesRequestParcel request,
499         in IReadMedicalResourcesResponseCallback callback);
500 
501     /**
502      * Delete from the HealthConnect database.
503      *
504      * @param attributionSource attribution source for the data.
505      * @param medicalResourceIds represents the ids to be deleted.
506      * @param callback Callback to receive result of performing this operation.
507      */
deleteMedicalResourcesByIds( in AttributionSource attributionSource, in List<MedicalResourceId> medicalResourceIds, in IEmptyResponseCallback callback)508     void deleteMedicalResourcesByIds(
509         in AttributionSource attributionSource,
510         in List<MedicalResourceId> medicalResourceIds,
511         in IEmptyResponseCallback callback);
512 
513     /**
514      * Delete from the HealthConnect database.
515      *
516      * @param attributionSource attribution source for the data.
517      * @param request represents a request specifying what to delete.
518      * @param callback Callback to receive result of performing this operation.
519      */
deleteMedicalResourcesByRequest( in AttributionSource attributionSource, in DeleteMedicalResourcesRequest request, in IEmptyResponseCallback callback)520     void deleteMedicalResourcesByRequest(
521         in AttributionSource attributionSource,
522         in DeleteMedicalResourcesRequest request,
523         in IEmptyResponseCallback callback);
524 
525     /**
526      * Returns information for each MedicalResourceType like medical permission category and
527      * contributing data sources.
528      *
529      * @param callback Callback to receive result of performing this operation.
530      */
queryAllMedicalResourceTypeInfos(in IMedicalResourceTypeInfosCallback callback)531     void queryAllMedicalResourceTypeInfos(in IMedicalResourceTypeInfosCallback callback);
532 
533     /**
534      * Returns the paganized changes for cloud backup based on the changeToken.
535      *
536      * @param changeToken Indicates whether and where to resume to the data backup.
537      * @param callback Callback to receive result of performing this operation.
538      */
getChangesForBackup(in @ullable String changeToken, in IGetChangesForBackupResponseCallback callback)539     void getChangesForBackup(in @nullable String changeToken, in IGetChangesForBackupResponseCallback callback);
540 
541     /**
542      * Returns the latest metadata for cloud backup.
543      *
544      * @param callback Callback to receive result of performing this operation.
545      */
getLatestMetadataForBackup(in IGetLatestMetadataForBackupResponseCallback callback)546     void getLatestMetadataForBackup(in IGetLatestMetadataForBackupResponseCallback callback);
547 
548     /**
549      * Restores the backed up metadata.
550      *
551      * @param backupMetadata Metadata that were previously backed up and to be restored.
552      * @param callback Callback to receive result of performing this operation.
553      */
restoreLatestMetadata(in BackupMetadata backupMetadata, in IEmptyResponseCallback callback)554     void restoreLatestMetadata(in BackupMetadata backupMetadata, in IEmptyResponseCallback callback);
555 
556     /**
557      * Returns whether the input data version can be restored.
558      *
559      * @param dataVersion Data version to be restored.
560      * @param callback Callback to receive result of performing this operation.
561      */
canRestore(in int dataVersion, in ICanRestoreResponseCallback callback)562      void canRestore(in int dataVersion, in ICanRestoreResponseCallback callback);
563 
564     /**
565      * Restores the backed up changes.
566      *
567      * @param changes Changes to be restored.
568      * @param callback Callback to receive result of performing this operation.
569      */
restoreChanges(in List<RestoreChange> changes, in IEmptyResponseCallback callback)570      void restoreChanges(in List<RestoreChange> changes, in IEmptyResponseCallback callback);
571 }
572