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:
committed by
Facebook GitHub Bot
parent
bba1275377
commit
ddc5554673
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
package com.facebook.flipper.plugins.uidebugger.core
|
package com.facebook.flipper.plugins.uidebugger.core
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
@@ -86,11 +87,12 @@ class RootViewResolver {
|
|||||||
try {
|
try {
|
||||||
viewsField?.let { vf ->
|
viewsField?.let { vf ->
|
||||||
// Forgive me father for I have sinned...
|
// Forgive me father for I have sinned...
|
||||||
|
@SuppressLint("DiscouragedPrivateApi")
|
||||||
val modifiers = Field::class.java.getDeclaredField("accessFlags")
|
val modifiers = Field::class.java.getDeclaredField("accessFlags")
|
||||||
modifiers.isAccessible = true
|
modifiers.isAccessible = true
|
||||||
modifiers.setInt(vf, vf.modifiers and Modifier.FINAL.inv())
|
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()
|
val observableViews = ObservableArrayList()
|
||||||
observableViews.setListener(listener)
|
observableViews.setListener(listener)
|
||||||
|
|||||||
Reference in New Issue
Block a user