summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Tuttle <juliatuttle@google.com> 2024-03-19 15:25:20 -0400
committer David Lin <dlinls@google.com> 2024-03-28 09:34:50 +0000
commite18b2958b09a12ce8b441a6c06c95af8f5366435 (patch)
tree70ae1e73ef64a89669d95a9738029e46d2af79a4
parentb75186ff30a64d92446ee346c299c82b7708e791 (diff)
CallStyle: Handle null icon to glue
Bug: <329288442> Flag: ACONFIG com.android.systemui.new_call_style_action_layout NEXTFOOD Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:19c7dd73f4d7f61e5858241c4c75dbd45722c779) Merged-In: I5e8b1bae7977f53ce8dd977d17231ec44268c486 Change-Id: I5e8b1bae7977f53ce8dd977d17231ec44268c486 24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
-rw-r--r--core/java/com/android/internal/widget/EmphasizedNotificationButton.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/com/android/internal/widget/EmphasizedNotificationButton.java b/core/java/com/android/internal/widget/EmphasizedNotificationButton.java
index 01b45697f5d4..c07e62414ac2 100644
--- a/core/java/com/android/internal/widget/EmphasizedNotificationButton.java
+++ b/core/java/com/android/internal/widget/EmphasizedNotificationButton.java
@@ -278,11 +278,6 @@ public class EmphasizedNotificationButton extends Button {
// be ready to glue. This can only happen if the button is initialized and displayed and
// *then* someone calls glueIcon or glueLabel.
- if (mIconToGlue == null) {
- Log.w(TAG, "glueIconAndLabelIfNeeded: label glued without icon; doing nothing");
- return;
- }
-
if (mLabelToGlue == null) {
Log.w(TAG, "glueIconAndLabelIfNeeded: icon glued without label; doing nothing");
return;
@@ -318,6 +313,14 @@ public class EmphasizedNotificationButton extends Button {
private static final String POP_DIRECTIONAL_ISOLATE = "\u2069";
private void glueIconAndLabel(int layoutDirection) {
+ if (mIconToGlue == null) {
+ if (DEBUG_NEW_ACTION_LAYOUT) {
+ Log.d(TAG, "glueIconAndLabel: null icon, setting text to label");
+ }
+ setText(mLabelToGlue);
+ return;
+ }
+
final boolean rtlLayout = layoutDirection == LAYOUT_DIRECTION_RTL;
if (DEBUG_NEW_ACTION_LAYOUT) {