Skip to content

Commit 45a9c5e

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
Fix Nullsafe FIXMEs for DebugOverlayController.java and mark nullsafe
Summary: 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 DebugOverlayController.java nullsafe Reviewed By: mdvacca Differential Revision: D71126394
1 parent a01a978 commit 45a9c5e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import android.widget.FrameLayout;
1919
import androidx.annotation.Nullable;
2020
import com.facebook.common.logging.FLog;
21+
import com.facebook.infer.annotation.Nullsafe;
2122
import com.facebook.react.bridge.ReactContext;
2223
import com.facebook.react.bridge.UiThreadUtil;
2324
import com.facebook.react.common.ReactConstants;
@@ -26,7 +27,8 @@
2627
* Helper class for controlling overlay view with FPS and JS FPS info that gets added directly
2728
* to @{link WindowManager} instance.
2829
*/
29-
/* package */ class DebugOverlayController {
30+
/* package */ @Nullsafe(Nullsafe.Mode.LOCAL)
31+
class DebugOverlayController {
3032

3133
public static void requestPermission(Context context) {
3234
// Get permission to show debug overlay in dev builds.
@@ -74,8 +76,7 @@ private static boolean hasPermission(Context context, String permission) {
7476

7577
private static boolean canHandleIntent(Context context, Intent intent) {
7678
PackageManager packageManager = context.getPackageManager();
77-
// NULLSAFE_FIXME[Parameter Not Nullable]
78-
return intent.resolveActivity(packageManager) != null;
79+
return packageManager != null && intent.resolveActivity(packageManager) != null;
7980
}
8081

8182
private final WindowManager mWindowManager;

0 commit comments

Comments
 (0)