From e545182223cf12fa381c255215f2063423e0d1be Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Mon, 20 Jan 2025 23:52:58 +0000 Subject: [PATCH] Add logging for RDeps lifecycle and ViewPool.initPool to help debugging. Bug: 390156722 Flag: com.android.launcher3.enable_refactor_task_thumbnail Test: none - logging only change Change-Id: I657194e79023598c17ca8b1885f98457f3d773a9 --- .../android/quickstep/recents/di/RecentsDependencies.kt | 7 +++++-- src/com/android/launcher3/util/ViewPool.java | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt b/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt index 2b364f954d..358537cb29 100644 --- a/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt +++ b/quickstep/src/com/android/quickstep/recents/di/RecentsDependencies.kt @@ -252,6 +252,7 @@ class RecentsDependencies private constructor(private val appContext: Context) { fun initialize(view: View): RecentsDependencies = initialize(view.context) fun initialize(context: Context): RecentsDependencies { + Log.d(TAG, "initializing") synchronized(this) { activeRecentsCount++ instance = RecentsDependencies(context.applicationContext) @@ -286,10 +287,12 @@ class RecentsDependencies private constructor(private val appContext: Context) { activeRecentsCount-- if (activeRecentsCount == 0) { instance.scopes.clear() + Log.d(TAG, "destroyed", Exception("Printing stack trace")) } else { - instance.log( + Log.d( + TAG, "RecentsDependencies was not destroyed. " + - "There is still an active RecentsView instance." + "There is still an active RecentsView instance.", ) } } diff --git a/src/com/android/launcher3/util/ViewPool.java b/src/com/android/launcher3/util/ViewPool.java index 2fa8bf4681..d1cd30f0d5 100644 --- a/src/com/android/launcher3/util/ViewPool.java +++ b/src/com/android/launcher3/util/ViewPool.java @@ -17,6 +17,7 @@ package com.android.launcher3.util; import android.content.Context; import android.os.Handler; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -33,6 +34,7 @@ import com.android.launcher3.util.ViewPool.Reusable; * During initialization, views are inflated on the background thread. */ public class ViewPool { + private static final String TAG = ViewPool.class.getSimpleName(); private final Object[] mPool; @@ -77,6 +79,7 @@ public class ViewPool { T view = inflateNewView(inflater); handler.post(() -> addToPool(view)); } + Log.d(TAG, "initPool complete"); }, "ViewPool-init").start(); }