Add suppression for deprecated setters and getters (#44676)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44676

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

Reviewed By: sumkit

Differential Revision: D57780503

fbshipit-source-id: 6201f7a3e597fef420de0f80dd2243bee78bc583
This commit is contained in:
Peter Abbondanzo
2024-05-24 10:41:12 -07:00
committed by Facebook GitHub Bot
parent 06461c4ab5
commit ac51deeaf4
@@ -31,6 +31,7 @@ import com.facebook.react.uimanager.PixelUtil
public class StatusBarModule(reactContext: ReactApplicationContext?) :
NativeStatusBarManagerAndroidSpec(reactContext) {
@Suppress("DEPRECATION")
override fun getTypedExportedConstants(): Map<String, Any> {
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()