From 5a2db6da7a5e659db2c87cc42fc39ecaef85b5e0 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 3 Mar 2022 14:54:55 -0800 Subject: [PATCH] Add error log for adding parented complications. Adding a complication view that already has a parent throws an IllegalStateException. This change adds an error log for that case that includes the class of the complication to make it easier to track down. The most likely cause of this is complication view reuse. Complication views should be created anew each time they are needed. Test: manually Bug: 220478774 Change-Id: Icaa070ae3c852e89e7203e4b3ff3ee42bf515ce0 --- .../complication/ComplicationHostViewController.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationHostViewController.java b/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationHostViewController.java index 62b319bd9e978..4e528bbe9386f 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationHostViewController.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/complication/ComplicationHostViewController.java @@ -21,6 +21,7 @@ import static com.android.systemui.dreams.complication.dagger.ComplicationModule import android.graphics.Rect; import android.graphics.Region; +import android.util.Log; import android.view.View; import androidx.constraintlayout.widget.ConstraintLayout; @@ -42,6 +43,8 @@ import javax.inject.Named; * a {@link ComplicationLayoutEngine}. */ public class ComplicationHostViewController extends ViewController { + public static final String TAG = "ComplicationHostViewController"; + private final ComplicationLayoutEngine mLayoutEngine; private final LifecycleOwner mLifecycleOwner; private final ComplicationCollectionViewModel mComplicationCollectionViewModel; @@ -113,6 +116,12 @@ public class ComplicationHostViewController extends ViewController