Merge "Make sure mParent is not null before using it" into sc-v2-dev am: 92b3fbcdb7 am: 1bba929193

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16182631

Change-Id: I7e7d2cef60236ba1e4cd37214e4aec0a38040529
This commit is contained in:
Tiger Huang
2021-11-05 15:09:58 +00:00
committed by Automerger Merge Worker

View File

@@ -20288,7 +20288,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@CallSuper
protected void onAttachedToWindow() {
if ((mPrivateFlags & PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) {
if (mParent != null && (mPrivateFlags & PFLAG_REQUEST_TRANSPARENT_REGIONS) != 0) {
mParent.requestTransparentRegion(this);
}
@@ -25070,7 +25070,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
View parent = this;
while (parent.mParent != null && parent.mParent instanceof View) {
while (parent.mParent instanceof View) {
parent = (View) parent.mParent;
}