diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index d4620d0e6687..51fcf8e6df2f 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -1814,22 +1814,6 @@ public final class com/facebook/react/common/SystemClock { public static final fun uptimeMillis ()J } -public abstract interface annotation class com/facebook/react/common/annotations/DeprecatedInNewArchitecture : java/lang/annotation/Annotation { - public abstract fun message ()Ljava/lang/String; -} - -public abstract interface annotation class com/facebook/react/common/annotations/FrameworkAPI : java/lang/annotation/Annotation { -} - -public abstract interface annotation class com/facebook/react/common/annotations/StableReactNativeAPI : java/lang/annotation/Annotation { -} - -public abstract interface annotation class com/facebook/react/common/annotations/UnstableReactNativeAPI : java/lang/annotation/Annotation { -} - -public abstract interface annotation class com/facebook/react/common/annotations/VisibleForTesting : java/lang/annotation/Annotation { -} - public final class com/facebook/react/common/assets/ReactFontManager { public static final field Companion Lcom/facebook/react/common/assets/ReactFontManager$Companion; public fun ()V @@ -3697,39 +3681,6 @@ public final class com/facebook/react/runtime/hermes/HermesInstance : com/facebo public final class com/facebook/react/runtime/hermes/HermesInstance$Companion { } -public class com/facebook/react/runtime/internal/bolts/Task : com/facebook/react/interfaces/TaskInterface { - public static final field IMMEDIATE_EXECUTOR Ljava/util/concurrent/Executor; - public static final field UI_THREAD_EXECUTOR Ljava/util/concurrent/Executor; - public static fun call (Ljava/util/concurrent/Callable;)Lcom/facebook/react/runtime/internal/bolts/Task; - public static fun call (Ljava/util/concurrent/Callable;Ljava/util/concurrent/Executor;)Lcom/facebook/react/runtime/internal/bolts/Task; - public static fun cancelled ()Lcom/facebook/react/runtime/internal/bolts/Task; - public fun continueWith (Lcom/facebook/react/runtime/internal/bolts/Continuation;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun continueWith (Lcom/facebook/react/runtime/internal/bolts/Continuation;Ljava/util/concurrent/Executor;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun continueWithTask (Lcom/facebook/react/runtime/internal/bolts/Continuation;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun continueWithTask (Lcom/facebook/react/runtime/internal/bolts/Continuation;Ljava/util/concurrent/Executor;)Lcom/facebook/react/runtime/internal/bolts/Task; - public static fun create ()Lcom/facebook/react/runtime/internal/bolts/TaskCompletionSource; - public static fun forError (Ljava/lang/Exception;)Lcom/facebook/react/runtime/internal/bolts/Task; - public static fun forResult (Ljava/lang/Object;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun getError ()Ljava/lang/Exception; - public fun getResult ()Ljava/lang/Object; - public static fun getUnobservedExceptionHandler ()Lcom/facebook/react/runtime/internal/bolts/Task$UnobservedExceptionHandler; - public fun isCancelled ()Z - public fun isCompleted ()Z - public fun isFaulted ()Z - public fun makeVoid ()Lcom/facebook/react/runtime/internal/bolts/Task; - public fun onSuccess (Lcom/facebook/react/runtime/internal/bolts/Continuation;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun onSuccess (Lcom/facebook/react/runtime/internal/bolts/Continuation;Ljava/util/concurrent/Executor;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun onSuccessTask (Lcom/facebook/react/runtime/internal/bolts/Continuation;)Lcom/facebook/react/runtime/internal/bolts/Task; - public fun onSuccessTask (Lcom/facebook/react/runtime/internal/bolts/Continuation;Ljava/util/concurrent/Executor;)Lcom/facebook/react/runtime/internal/bolts/Task; - public static fun setUnobservedExceptionHandler (Lcom/facebook/react/runtime/internal/bolts/Task$UnobservedExceptionHandler;)V - public fun waitForCompletion ()V - public fun waitForCompletion (JLjava/util/concurrent/TimeUnit;)Z -} - -public abstract interface class com/facebook/react/runtime/internal/bolts/Task$UnobservedExceptionHandler { - public abstract fun unobservedException (Lcom/facebook/react/runtime/internal/bolts/Task;Lcom/facebook/react/runtime/internal/bolts/UnobservedTaskException;)V -} - public final class com/facebook/react/shell/MainPackageConfig { public fun (Lcom/facebook/imagepipeline/core/ImagePipelineConfig;)V public final fun getFrescoConfig ()Lcom/facebook/imagepipeline/core/ImagePipelineConfig; diff --git a/packages/react-native/ReactAndroid/gradle.properties b/packages/react-native/ReactAndroid/gradle.properties index 8866d933a00e..71d07065b155 100644 --- a/packages/react-native/ReactAndroid/gradle.properties +++ b/packages/react-native/ReactAndroid/gradle.properties @@ -21,10 +21,13 @@ binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\ com.facebook.perftest,\ com.facebook.proguard,\ com.facebook.react.bridgeless.internal,\ + com.facebook.react.common.annotations,\ + com.facebook.react.fabric.internal.interop,\ com.facebook.react.flipper,\ com.facebook.react.internal,\ com.facebook.react.module.processing,\ com.facebook.react.processing,\ + com.facebook.react.runtime.internal,\ com.facebook.react.views.text.internal,\ com.facebook.systrace,\ com.facebook.yoga diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitecture.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitecture.kt new file mode 100644 index 000000000000..351a85ffae32 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitecture.kt @@ -0,0 +1,24 @@ +/* + * 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.common.annotations.internal + +/** + * Annotation to mark classes or functions that are part of the legacy architecture. + * + * This annotation is used to indicate that the annotated class or function is part of the legacy + * architecture. The `logLevel` parameter can be used to specify the level of logging that should be + * applied when the annotated element is used. + * + * @property logLevel The logging level to be used for the annotated element. Defaults to + * `LegacyArchitectureLogLevel.WARNING`. + */ +@Retention(AnnotationRetention.SOURCE) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +public annotation class LegacyArchitecture( + val logLevel: LegacyArchitectureLogLevel = LegacyArchitectureLogLevel.WARNING +) {} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitectureLogLevel.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitectureLogLevel.kt new file mode 100644 index 000000000000..a28508b0f357 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/internal/LegacyArchitectureLogLevel.kt @@ -0,0 +1,22 @@ +/* + * 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.common.annotations.internal + +/** + * Enum class representing the log levels for classes annotated with @LegacyArcture annoation. + * + * It provides two levels of logging: + * - WARNING: Indicates a warning signal will be logged if the underlying class is used when the new + * architecture is enabled. + * - ERROR: : Indicates an error signal will be logged if the underlying class is used when the new + * architecture is enabled. + */ +public enum class LegacyArchitectureLogLevel { + WARNING, + ERROR +}