File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
maps-compose/src/main/java/com/google/maps/android/compose/internal Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ import androidx.compose.runtime.State
66import androidx.compose.runtime.mutableStateOf
77import com.google.android.gms.maps.MapsApiSettings
88import com.google.maps.android.compose.meta.AttributionId
9- import kotlinx.coroutines.CoroutineScope
109import kotlinx.coroutines.Dispatchers
11- import kotlinx.coroutines.launch
10+ import kotlinx.coroutines.withContext
1211import java.util.concurrent.atomic.AtomicBoolean
1312
1413/* *
@@ -27,9 +26,9 @@ internal object MapsApiAttribution {
2726 *
2827 * @param context The context to use to add the attribution ID.
2928 */
30- fun addAttributionId (context : Context ) {
29+ suspend fun addAttributionId (context : Context ) {
3130 if (hasBeenCalled.compareAndSet(false , true )) {
32- CoroutineScope (Dispatchers .IO ).launch {
31+ withContext (Dispatchers .IO ) {
3332 MapsApiSettings .addInternalUsageAttributionId(context, AttributionId .VALUE )
3433 _isInitialized .value = true
3534 }
You can’t perform that action at this time.
0 commit comments