From 2c38f934ad1ac2ce116f6f7d5568cfafb9b6b7ce Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 4 Mar 2024 02:21:15 -0800 Subject: [PATCH] Add TODOs for missing ReactActivityDelegate methods (#43294) Summary: These are gated by `ReactFeatureFlags.enableBridgelessArchitecture` and are missing support. They should be evaluated for backwards compatibility Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D54422143 --- .../facebook/react/ReactActivityDelegate.java | 20 ++++++++++++++----- .../com/facebook/react/ReactDelegate.java | 1 - 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java index ebeffc994952a2..01c3b7ed42dfc0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java @@ -132,7 +132,9 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { } public boolean onKeyDown(int keyCode, KeyEvent event) { - if (!ReactFeatureFlags.enableBridgelessArchitecture) { + if (ReactFeatureFlags.enableBridgelessArchitecture) { + // TODO T156475655: support onKeyDown + } else { if (getReactNativeHost().hasInstance() && getReactNativeHost().getUseDeveloperSupport() && keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { @@ -148,7 +150,9 @@ public boolean onKeyUp(int keyCode, KeyEvent event) { } public boolean onKeyLongPress(int keyCode, KeyEvent event) { - if (!ReactFeatureFlags.enableBridgelessArchitecture) { + if (ReactFeatureFlags.enableBridgelessArchitecture) { + // TODO T156475655: support onKeyLongPress + } else { if (getReactNativeHost().hasInstance() && getReactNativeHost().getUseDeveloperSupport() && keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { @@ -164,7 +168,9 @@ public boolean onBackPressed() { } public boolean onNewIntent(Intent intent) { - if (!ReactFeatureFlags.enableBridgelessArchitecture) { + if (ReactFeatureFlags.enableBridgelessArchitecture) { + // TODO T156475655: support onNewIntent + } else { if (getReactNativeHost().hasInstance()) { getReactNativeHost().getReactInstanceManager().onNewIntent(intent); return true; @@ -174,7 +180,9 @@ public boolean onNewIntent(Intent intent) { } public void onWindowFocusChanged(boolean hasFocus) { - if (!ReactFeatureFlags.enableBridgelessArchitecture) { + if (ReactFeatureFlags.enableBridgelessArchitecture) { + // TODO T156475655: support onWindowFocusChanged + } else { if (getReactNativeHost().hasInstance()) { getReactNativeHost().getReactInstanceManager().onWindowFocusChange(hasFocus); } @@ -182,7 +190,9 @@ public void onWindowFocusChanged(boolean hasFocus) { } public void onConfigurationChanged(Configuration newConfig) { - if (!ReactFeatureFlags.enableBridgelessArchitecture) { + if (ReactFeatureFlags.enableBridgelessArchitecture) { + // TODO T156475655: support onConfigurationChanged + } else { if (getReactNativeHost().hasInstance()) { getReactInstanceManager().onConfigurationChanged(getContext(), newConfig); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java index 2e2e23155cb5b9..2b69d2904aa417 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java @@ -139,7 +139,6 @@ public void onActivityResult( int requestCode, int resultCode, Intent data, boolean shouldForwardToReactInstance) { if (ReactFeatureFlags.enableBridgelessArchitecture) { // TODO T156475655: Implement onActivityResult for Bridgeless - return; } else { if (getReactNativeHost().hasInstance() && shouldForwardToReactInstance) { getReactNativeHost()