Restrict reflection access to View methods

Restricted reflection access to:
- dispatchAttachedToWindow
- dispatchDetachedFromWindow

Those should not be used directly as it violates internal code
guarantees. Instead Views need to be actually attached to the window.

Bug: 123769352, 123769370
Test: n/a

Change-Id: I0006bc99a2d10747e931e944caee21932c4642dd
This commit is contained in:
Jakub Gielzak
2019-02-05 18:20:21 +00:00
parent 80ced71afd
commit 4ba27796a6

View File

@@ -19413,7 +19413,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @param info the {@link android.view.View.AttachInfo} to associated with
* this view
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
void dispatchAttachedToWindow(AttachInfo info, int visibility) {
mAttachInfo = info;
if (mOverlay != null) {
@@ -19479,7 +19479,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
notifyAppearedOrDisappearedForContentCaptureIfNeeded(true);
}
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
void dispatchDetachedFromWindow() {
AttachInfo info = mAttachInfo;
if (info != null) {