From 59b90a43bd062f304cd999b3734e36216b8cc8e6 Mon Sep 17 00:00:00 2001 From: Merissa Tan Date: Thu, 29 Sep 2022 11:16:25 -0700 Subject: [PATCH] Add a null check to avoid NPE. Because getTextCursorDrawable() can return null, this CL adds a null check so that it won't cause a NPE on ARC++. Bug: 244632907 Test: Manual Change-Id: I96a7817b2697eedff9f35762124a97d9e04992a8 --- .../android/systemui/statusbar/policy/RemoteInputView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index 5a33603d81ce8..da6d455fbb970 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -221,8 +221,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEditText.setTextColor(textColor); mEditText.setHintTextColor(hintColor); - mEditText.getTextCursorDrawable().setColorFilter( - accentColor.getDefaultColor(), PorterDuff.Mode.SRC_IN); + if (mEditText.getTextCursorDrawable() != null) { + mEditText.getTextCursorDrawable().setColorFilter( + accentColor.getDefaultColor(), PorterDuff.Mode.SRC_IN); + } mContentBackground.setColor(editBgColor); mContentBackground.setStroke(stroke, accentColor); mDelete.setImageTintList(ColorStateList.valueOf(deleteFgColor));