mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerftestDevSupportManager.java (#45684)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45684 Changelog: [Internal] Differential Revision: D60233489 fbshipit-source-id: 00f0ab65824415242925a5a8e85793487dc251e0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c6f89c300d
commit
7c1740a44c
-50
@@ -1,50 +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.devsupport;
|
||||
|
||||
import android.content.Context;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
|
||||
|
||||
/**
|
||||
* Interface for accessing and interacting with development features related to performance testing.
|
||||
* Communication is enabled via the Inspector, but everything else is disabled.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public final class PerftestDevSupportManager extends ReleaseDevSupportManager {
|
||||
private final DevServerHelper mDevServerHelper;
|
||||
private final DeveloperSettings mDevSettings;
|
||||
|
||||
public PerftestDevSupportManager(Context applicationContext) {
|
||||
mDevSettings =
|
||||
new DevInternalSettings(
|
||||
applicationContext,
|
||||
new DevInternalSettings.Listener() {
|
||||
@Override
|
||||
public void onInternalSettingsChanged() {}
|
||||
});
|
||||
mDevServerHelper =
|
||||
new DevServerHelper(
|
||||
mDevSettings, applicationContext, mDevSettings.getPackagerConnectionSettings());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeveloperSettings getDevSettings() {
|
||||
return mDevSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startInspector() {
|
||||
mDevServerHelper.openInspectorConnection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopInspector() {
|
||||
mDevServerHelper.closeInspectorConnection();
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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.devsupport
|
||||
|
||||
import android.content.Context
|
||||
import com.facebook.react.modules.debug.interfaces.DeveloperSettings
|
||||
|
||||
/**
|
||||
* Interface for accessing and interacting with development features related to performance testing.
|
||||
* Communication is enabled via the Inspector, but everything else is disabled.
|
||||
*/
|
||||
public class PerftestDevSupportManager(
|
||||
applicationContext: Context,
|
||||
) : ReleaseDevSupportManager() {
|
||||
|
||||
override public val devSettings: DeveloperSettings =
|
||||
DevInternalSettings(
|
||||
applicationContext,
|
||||
object : DevInternalSettings.Listener {
|
||||
override fun onInternalSettingsChanged() = Unit
|
||||
})
|
||||
|
||||
private val devServerHelper: DevServerHelper =
|
||||
DevServerHelper(devSettings, applicationContext, devSettings.packagerConnectionSettings)
|
||||
|
||||
override fun startInspector() {
|
||||
devServerHelper.openInspectorConnection()
|
||||
}
|
||||
|
||||
override fun stopInspector() {
|
||||
devServerHelper.closeInspectorConnection()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user