From 673ab4f395f2610519a529ac397bc09bc4566e34 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Fri, 24 May 2024 08:53:33 -0700 Subject: [PATCH] Add suppression for deprecated setters and getters Summary: Some of the setters and getters in these functions, like [`getStatusBarColor`](https://developer.android.com/reference/android/view/Window#getStatusBarColor), have been marked as deprecated in [`VANILLA_ICE_CREAM`](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). This change suppresses deprecation warnings until we can move to newer alternatives. ## Changelog [Android] [Changed] - Added suppression for deprecated getter/setter usage in StatusBarModule Differential Revision: D57780503 --- .../com/facebook/react/modules/statusbar/StatusBarModule.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt index ad6ec6197e2792..14857b9f2884b6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt @@ -31,6 +31,7 @@ import com.facebook.react.uimanager.PixelUtil public class StatusBarModule(reactContext: ReactApplicationContext?) : NativeStatusBarManagerAndroidSpec(reactContext) { + @Suppress("DEPRECATION") override fun getTypedExportedConstants(): Map { val context = getReactApplicationContext() val heightResId = context.resources.getIdentifier("status_bar_height", "dimen", "android") @@ -53,6 +54,7 @@ public class StatusBarModule(reactContext: ReactApplicationContext?) : ) } + @Suppress("DEPRECATION") override fun setColor(colorDouble: Double, animated: Boolean) { val color = colorDouble.toInt() val activity = getCurrentActivity()