Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around OkHttpNetworkFetcher crash. #2658

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions coil-network-okhttp/api/android/coil-network-okhttp.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ public final class coil3/network/okhttp/OkHttpNetworkFetcher {
public static final fun asNetworkClient (Lokhttp3/Call$Factory;)Lcoil3/network/NetworkClient;
public static final fun factory ()Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lokhttp3/Call$Factory;)Lcoil3/network/NetworkFetcher$Factory;
public static synthetic fun factory$default (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lcoil3/network/NetworkFetcher$Factory;
public static synthetic fun factory$default (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcoil3/network/NetworkFetcher$Factory;
}

2 changes: 2 additions & 0 deletions coil-network-okhttp/api/jvm/coil-network-okhttp.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ public final class coil3/network/okhttp/OkHttpNetworkFetcher {
public static final fun asNetworkClient (Lokhttp3/Call$Factory;)Lcoil3/network/NetworkClient;
public static final fun factory ()Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Lcoil3/network/NetworkFetcher$Factory;
public static final fun factory (Lokhttp3/Call$Factory;)Lcoil3/network/NetworkFetcher$Factory;
public static synthetic fun factory$default (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lcoil3/network/NetworkFetcher$Factory;
public static synthetic fun factory$default (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcoil3/network/NetworkFetcher$Factory;
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ fun OkHttpNetworkFetcherFactory(
networkClient = { callFactory().asNetworkClient() },
)

@JvmName("factory")
fun OkHttpNetworkFetcherFactory(
callFactory: () -> Call.Factory = ::OkHttpClient,
cacheStrategy: () -> CacheStrategy = { CacheStrategy.DEFAULT },
) = NetworkFetcher.Factory(
networkClient = { callFactory().asNetworkClient() },
cacheStrategy = cacheStrategy,
)

@JvmName("factory")
fun OkHttpNetworkFetcherFactory(
callFactory: () -> Call.Factory = ::OkHttpClient,
Expand Down