summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/NotificationHeaderView.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java
index df680c054f56..fe868e1c43be 100644
--- a/core/java/android/view/NotificationHeaderView.java
+++ b/core/java/android/view/NotificationHeaderView.java
@@ -223,8 +223,14 @@ public class NotificationHeaderView extends RelativeLayout {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (notificationsRedesignTemplates()) {
- mTopLineTranslation = measureCenterTranslation(mTopLineView);
- mExpandButtonTranslation = measureCenterTranslation(mExpandButton);
+ // TODO: b/378660052 - These should never be null in practice, consider using
+ // requireViewById() in the onFinishInflate.
+ if (mTopLineView != null) {
+ mTopLineTranslation = measureCenterTranslation(mTopLineView);
+ }
+ if (mExpandButton != null) {
+ mExpandButtonTranslation = measureCenterTranslation(mExpandButton);
+ }
}
}