From 29cc2357e256aaa0e68bfaf7f155dd3b675f2cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Guzm=C3=A1n?= Date: Mon, 28 Apr 2025 01:23:25 -0700 Subject: [PATCH] Remove unused com.facebook.react.bridge.MemoryPressure class (#50924) Summary: This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.MemoryPressure). Edit: we can remove it as has no usages ## Changelog: [INTERNAL] - Remove unused com.facebook.react.bridge.MemoryPressure class Pull Request resolved: https://github.com/facebook/react-native/pull/50924 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: javache Differential Revision: D73643870 Pulled By: rshest fbshipit-source-id: 80c9abe82352a13cdd9f4110349e03656d423a05 --- .../ReactAndroid/api/ReactAndroid.api | 9 --------- .../com/facebook/react/bridge/MemoryPressure.kt | 17 ----------------- 2 files changed, 26 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressure.kt diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 2dad9b8865e..f879b8f0b24 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -932,15 +932,6 @@ public abstract interface class com/facebook/react/bridge/LifecycleEventListener public abstract fun onHostResume ()V } -public final class com/facebook/react/bridge/MemoryPressure : java/lang/Enum { - public static final field CRITICAL Lcom/facebook/react/bridge/MemoryPressure; - public static final field MODERATE Lcom/facebook/react/bridge/MemoryPressure; - public static final field UI_HIDDEN Lcom/facebook/react/bridge/MemoryPressure; - public static fun getEntries ()Lkotlin/enums/EnumEntries; - public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/bridge/MemoryPressure; - public static fun values ()[Lcom/facebook/react/bridge/MemoryPressure; -} - public abstract interface class com/facebook/react/bridge/MemoryPressureListener { public abstract fun handleMemoryPressure (I)V } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressure.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressure.kt deleted file mode 100644 index a11e192eff7..00000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/MemoryPressure.kt +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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.bridge - -import com.facebook.react.common.annotations.internal.LegacyArchitecture - -@LegacyArchitecture -public enum class MemoryPressure { - UI_HIDDEN, - MODERATE, - CRITICAL -}