Adding null check for mNotificationShadeView

mNotificationShadeView sometimes is not initialized and it causes NPE
in some of CTS tests. Adding null check to fix the issues.

Bug: 222130505
Test: atest CompatChangeTests
Change-Id: I4360f89fd52e0f056f59eb39885569b5b57561ea
This commit is contained in:
armenk
2022-03-10 10:36:58 -08:00
parent edf4b8bbfe
commit 5da1b26198

View File

@@ -386,10 +386,12 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
}
visible = true;
}
if (visible) {
mNotificationShadeView.setVisibility(View.VISIBLE);
} else {
mNotificationShadeView.setVisibility(View.INVISIBLE);
if (mNotificationShadeView != null) {
if (visible) {
mNotificationShadeView.setVisibility(View.VISIBLE);
} else {
mNotificationShadeView.setVisibility(View.INVISIBLE);
}
}
}