diff options
Diffstat (limited to 'apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt')
-rw-r--r-- | apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt b/apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt index 5f5e0e3a..21d48705 100644 --- a/apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt +++ b/apk/src/com/android/healthconnect/controller/datasources/api/UpdatePriorityListUseCase.kt @@ -1,3 +1,16 @@ +/** + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ package com.android.healthconnect.controller.datasources.api import android.health.connect.HealthConnectManager @@ -17,10 +30,13 @@ class UpdatePriorityListUseCase constructor( private val healthConnectManager: HealthConnectManager, @IoDispatcher private val dispatcher: CoroutineDispatcher -): IUpdatePriorityListUseCase { +) : IUpdatePriorityListUseCase { /** Updates the priority list of the stored [DataOrigin]s for given [HealthDataCategory]. */ - override suspend operator fun invoke(priorityList: List<String>, category: @HealthDataCategoryInt Int) { + override suspend operator fun invoke( + priorityList: List<String>, + category: @HealthDataCategoryInt Int + ) { withContext(dispatcher) { val dataOrigins: List<DataOrigin> = priorityList |