Remove legacy perf overlay from DevMenu (#53328)

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

Disables the legacy performance overlay toggle from the Android DevMenu to make way for V2.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D79791703

fbshipit-source-id: c99ac95e2907ce978ef0c2711ad304c9a3f278ec
This commit is contained in:
Devan Buggay
2025-08-29 03:14:56 -07:00
committed by Facebook GitHub Bot
parent 6a0b9d135d
commit 52937337c3
@@ -450,26 +450,29 @@ public abstract class DevSupportManagerBase(
}
}
val fpsDebugLabel =
if (devSettings.isFpsDebugEnabled)
applicationContext.getString(R.string.catalyst_perf_monitor_stop)
else applicationContext.getString(R.string.catalyst_perf_monitor)
options[fpsDebugLabel] = DevOptionHandler {
if (!devSettings.isFpsDebugEnabled) {
// Request overlay permission if needed when "Show Perf Monitor" option is selected
val context: Context? = reactInstanceDevHelper.currentActivity
if (context == null) {
FLog.e(ReactConstants.TAG, "Unable to get reference to react activity")
} else {
requestPermission(context)
// Do not show legacy performance overlay if V2 is enabled
if (!ReactNativeFeatureFlags.perfMonitorV2Enabled()) {
val fpsDebugLabel =
if (devSettings.isFpsDebugEnabled)
applicationContext.getString(R.string.catalyst_perf_monitor_stop)
else applicationContext.getString(R.string.catalyst_perf_monitor)
options[fpsDebugLabel] = DevOptionHandler {
if (!devSettings.isFpsDebugEnabled) {
// Request overlay permission if needed when "Show Perf Monitor" option is selected
val context: Context? = reactInstanceDevHelper.currentActivity
if (context == null) {
FLog.e(ReactConstants.TAG, "Unable to get reference to react activity")
} else {
requestPermission(context)
}
}
devSettings.isFpsDebugEnabled = !devSettings.isFpsDebugEnabled
}
options[applicationContext.getString(R.string.catalyst_settings)] = DevOptionHandler {
val intent = Intent(applicationContext, DevSettingsActivity::class.java)
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
applicationContext.startActivity(intent)
}
devSettings.isFpsDebugEnabled = !devSettings.isFpsDebugEnabled
}
options[applicationContext.getString(R.string.catalyst_settings)] = DevOptionHandler {
val intent = Intent(applicationContext, DevSettingsActivity::class.java)
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
applicationContext.startActivity(intent)
}
if (customDevOptions.isNotEmpty()) {