diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java index 35d7471fef..21a025c573 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java @@ -87,9 +87,6 @@ public class DevSupportManagerImpl implements DevSupportManager { private static final String EXOPACKAGE_LOCATION_FORMAT = "/data/local/tmp/exopackage/%s//secondary-dex"; - private static final int JAVA_SAMPLING_PROFILE_MEMORY_BYTES = 8 * 1024 * 1024; - private static final int JAVA_SAMPLING_PROFILE_DELTA_US = 100; - private final Context mApplicationContext; private final ShakeDetector mShakeDetector; private final BroadcastReceiver mReloadAppBroadcastReceiver; @@ -109,8 +106,6 @@ public class DevSupportManagerImpl implements DevSupportManager { private boolean mIsReceiverRegistered = false; private boolean mIsShakeDetectorStarted = false; private boolean mIsDevSupportEnabled = false; - private boolean mIsCurrentlyProfiling = false; - private int mProfileIndex = 0; private @Nullable RedBoxHandler mRedBoxHandler; public DevSupportManagerImpl( @@ -355,42 +350,6 @@ public class DevSupportManagerImpl implements DevSupportManager { } } }); - if (mCurrentContext != null && - mCurrentContext.getCatalystInstance() != null && - !mCurrentContext.getCatalystInstance().isDestroyed() && - mCurrentContext.getCatalystInstance().supportsProfiling()) { - options.put( - mApplicationContext.getString( - mIsCurrentlyProfiling ? R.string.catalyst_stop_profile : - R.string.catalyst_start_profile), - new DevOptionHandler() { - @Override - public void onOptionSelected() { - if (mCurrentContext != null && mCurrentContext.hasActiveCatalystInstance()) { - String profileName = (Environment.getExternalStorageDirectory().getPath() + - "/profile_" + mProfileIndex + ".json"); - if (mIsCurrentlyProfiling) { - mIsCurrentlyProfiling = false; - mProfileIndex++; - Debug.stopMethodTracing(); - mCurrentContext.getCatalystInstance() - .stopProfiler("profile", profileName); - Toast.makeText( - mCurrentContext, - "Profile output to " + profileName, - Toast.LENGTH_LONG).show(); - } else { - mIsCurrentlyProfiling = true; - mCurrentContext.getCatalystInstance().startProfiler("profile"); - Debug.startMethodTracingSampling( - profileName, - JAVA_SAMPLING_PROFILE_MEMORY_BYTES, - JAVA_SAMPLING_PROFILE_DELTA_US); - } - } - } - }); - } options.put( mApplicationContext.getString(R.string.catalyst_settings), new DevOptionHandler() { @Override @@ -550,16 +509,6 @@ public class DevSupportManagerImpl implements DevSupportManager { return; } - // if currently profiling stop and write the profile file - if (mIsCurrentlyProfiling) { - mIsCurrentlyProfiling = false; - String profileName = (Environment.getExternalStorageDirectory().getPath() + - "/profile_" + mProfileIndex + ".json"); - mProfileIndex++; - Debug.stopMethodTracing(); - mCurrentContext.getCatalystInstance().stopProfiler("profile", profileName); - } - mCurrentContext = reactContext; // Recreate debug overlay controller with new CatalystInstance object diff --git a/ReactAndroid/src/main/res/devsupport/values/strings.xml b/ReactAndroid/src/main/res/devsupport/values/strings.xml index edf2669c1c..fc84ce1d28 100644 --- a/ReactAndroid/src/main/res/devsupport/values/strings.xml +++ b/ReactAndroid/src/main/res/devsupport/values/strings.xml @@ -17,7 +17,5 @@ Connecting to remote debugger Unable to connect with remote debugger Toggle Inspector - Start Profile - Stop Profile Capture Heap