Suppress warnings for RootViewResolver

Summary:
^

There's no way to address these warnings, so suppress.

Reviewed By: LukeDefeo

Differential Revision: D39575262

fbshipit-source-id: 6703476d7637c63aa9a81b26f8cdbd0f53e3991c
This commit is contained in:
Lorenzo Blasa
2022-09-20 05:15:50 -07:00
committed by Facebook GitHub Bot
parent bba1275377
commit ddc5554673

View File

@@ -7,6 +7,7 @@
package com.facebook.flipper.plugins.uidebugger.core
import android.annotation.SuppressLint
import android.os.Build
import android.view.View
import android.view.WindowManager
@@ -86,11 +87,12 @@ class RootViewResolver {
try {
viewsField?.let { vf ->
// Forgive me father for I have sinned...
@SuppressLint("DiscouragedPrivateApi")
val modifiers = Field::class.java.getDeclaredField("accessFlags")
modifiers.isAccessible = true
modifiers.setInt(vf, vf.modifiers and Modifier.FINAL.inv())
val views = vf[windowManagerObj] as List<View>
@Suppress("unchecked_cast") val views = vf[windowManagerObj] as List<View>
val observableViews = ObservableArrayList()
observableViews.setListener(listener)