From 675e480fb9db65cf677a6ad4cd203c9bef3fb1e1 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 10 Jun 2021 16:45:35 -0700 Subject: [PATCH] Refactor: Make DevSupportManager not conform to DevInternalSettings.Listener Summary: ## Rationale This reduces the surface area of DevSupportManager's public API. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D29006836 fbshipit-source-id: 579364f6c556b8588f3b6bac79df3deb244a92e5 --- .../react/devsupport/DevSupportManagerBase.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 32c6672d4a1..b6d2f57f564 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -60,8 +60,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; -public abstract class DevSupportManagerBase - implements DevSupportManager, PackagerCommandListener, DevInternalSettings.Listener { +public abstract class DevSupportManagerBase implements DevSupportManager, PackagerCommandListener { public interface CallbackWithBundleLoader { void onSuccess(JSBundleLoader bundleLoader); @@ -135,7 +134,15 @@ public abstract class DevSupportManagerBase mReactInstanceDevHelper = reactInstanceDevHelper; mApplicationContext = applicationContext; mJSAppBundleName = packagerPathForJSBundleName; - mDevSettings = new DevInternalSettings(applicationContext, this); + mDevSettings = + new DevInternalSettings( + applicationContext, + new DevInternalSettings.Listener() { + @Override + public void onInternalSettingsChanged() { + reloadSettings(); + } + }); mBundleStatus = new InspectorPackagerConnection.BundleStatus(); mDevServerHelper = new DevServerHelper( @@ -811,10 +818,6 @@ public abstract class DevSupportManagerBase } } - public void onInternalSettingsChanged() { - reloadSettings(); - } - protected @Nullable ReactContext getCurrentContext() { return mCurrentContext; }