Skip to content
Closed
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
5 changes: 3 additions & 2 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -1936,8 +1936,9 @@ public final class com/facebook/react/common/mapbuffer/WritableMapBuffer : com/f
public final fun put (IZ)Lcom/facebook/react/common/mapbuffer/WritableMapBuffer;
}

public class com/facebook/react/common/network/OkHttpCallUtil {
public static fun cancelTag (Lokhttp3/OkHttpClient;Ljava/lang/Object;)V
public final class com/facebook/react/common/network/OkHttpCallUtil {
public static final field INSTANCE Lcom/facebook/react/common/network/OkHttpCallUtil;
public static final fun cancelTag (Lokhttp3/OkHttpClient;Ljava/lang/Object;)V
}

public class com/facebook/react/config/ReactFeatureFlags {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.common.network

import okhttp3.OkHttpClient

/**
* Helper class that provides the necessary methods for canceling queued and running OkHttp calls
*/
public object OkHttpCallUtil {

@JvmStatic
public fun cancelTag(client: OkHttpClient, tag: Any) {
for (call in client.dispatcher().queuedCalls()) {
if (tag == call.request().tag()) {
call.cancel()
return
}
}
for (call in client.dispatcher().runningCalls()) {
if (tag == call.request().tag()) {
call.cancel()
return
}
}
}
}