For those getting Accessing hidden method XYZ
on Android 9 (Pie, API 28):
Some methods greylisted in Android 9 were then whitelisted in Android 10. Before looking for any alternatives to greylisted methods check https://developer.android.com/about/versions/10/non-sdk-q#greylist-now-public
This does notapply to the methods in OP's question (computeFitSystemWindows
, makeOptionalFitsSystemWindows
) at the moment but may change in future Android releases.
See also https://developer.android.com/about/versions/10/non-sdk-q#greylist-now-restricted which presents:
non-SDK interfaces from the greylist in Android 9 (API level 28) that are now restricted in Android 10 (API level 29). Wherever possible, alternative APIs are suggested in a comment following the name of the interface.
E.g. all common methods reported by Android 9 light greylist filter:
Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
are now whitelisted in Android 10 so the logcat warn can be safely ignored (at least until Android 11 which may greylist them again :)).