Skip to content

Commit 4dd47ee

Browse files
gabrieldonadelfacebook-github-bot
authored andcommitted
Make PackagerConnectionSettings class open again (#47005)
Summary: When migrating `PackagerConnectionSettings` from Java to Kotlin in #45800 the new class ended up being declared as final, causing a breaking change in 0.76. We should add the `open` directive to `PackagerConnectionSettings.kt` to restore the old behavior. That would be crucial for the `expo-dev-client` package, given that Expo needs to be able to extend this class in order to overwrite the `debugServerHost` value. ## Changelog: [ANDROID] [FIXED] - Make PackagerConnectionSettings class open again Pull Request resolved: #47005 Test Plan: Run RNTester on Android Reviewed By: huntie Differential Revision: D64323645 Pulled By: cortinico fbshipit-source-id: 6870a3dee929ba664e4c402f321f84af7704f892
1 parent 6c19996 commit 4dd47ee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,13 +3770,13 @@ public abstract class com/facebook/react/packagerconnection/NotificationOnlyHand
37703770
public final fun onRequest (Ljava/lang/Object;Lcom/facebook/react/packagerconnection/Responder;)V
37713771
}
37723772

3773-
public final class com/facebook/react/packagerconnection/PackagerConnectionSettings {
3773+
public class com/facebook/react/packagerconnection/PackagerConnectionSettings {
37743774
public fun <init> (Landroid/content/Context;)V
37753775
public final fun getAdditionalOptionsForPackager ()Ljava/util/Map;
3776-
public final fun getDebugServerHost ()Ljava/lang/String;
3776+
public fun getDebugServerHost ()Ljava/lang/String;
37773777
public final fun getPackageName ()Ljava/lang/String;
37783778
public final fun setAdditionalOptionForPackager (Ljava/lang/String;Ljava/lang/String;)V
3779-
public final fun setDebugServerHost (Ljava/lang/String;)V
3779+
public fun setDebugServerHost (Ljava/lang/String;)V
37803780
}
37813781

37823782
public final class com/facebook/react/packagerconnection/ReconnectingWebSocket : okhttp3/WebSocketListener {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import android.preference.PreferenceManager
1515
import com.facebook.common.logging.FLog
1616
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers
1717

18-
public class PackagerConnectionSettings(private val appContext: Context) {
18+
public open class PackagerConnectionSettings(private val appContext: Context) {
1919
private val preferences: SharedPreferences =
2020
PreferenceManager.getDefaultSharedPreferences(appContext)
2121
public val packageName: String = appContext.packageName
2222
private val _additionalOptionsForPackager: MutableMap<String, String> = mutableMapOf()
2323

24-
public var debugServerHost: String
24+
public open var debugServerHost: String
2525
get() {
2626
// Check host setting first. If empty try to detect emulator type and use default
2727
// hostname for those

0 commit comments

Comments
 (0)