Fix Nullsafe FIXMEs for CxxInspectorPackagerConnection.java and mark nullsafe (#50062)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50062

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made CxxInspectorPackagerConnection.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126386

fbshipit-source-id: 94b6fca6972e5f08c22df7bebe6f853b5ceb20a7
This commit is contained in:
Gijs Weterings
2025-03-18 06:08:17 -07:00
committed by Facebook GitHub Bot
parent 0ba17b49f8
commit fd23a08a3a
@@ -10,6 +10,7 @@ package com.facebook.react.devsupport;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import java.io.Closeable;
@@ -21,7 +22,8 @@ import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
/** Java wrapper around a C++ InspectorPackagerConnection. */
/* package */ class CxxInspectorPackagerConnection implements IInspectorPackagerConnection {
/* package */ @Nullsafe(Nullsafe.Mode.LOCAL)
class CxxInspectorPackagerConnection implements IInspectorPackagerConnection {
static {
DevSupportSoLoader.staticInit();
}
@@ -39,8 +41,7 @@ import okhttp3.WebSocketListener;
public native void closeQuietly();
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
public native void sendEventToAllConnections(String event);
public native void sendEventToAllConnections(@Nullable String event);
/** Java wrapper around a C++ IWebSocketDelegate, allowing us to call the interface from Java. */
@DoNotStrip