Add better logging around long launcher operations during unfold
This logging helps understanding what's going on in Launcher main thread
during unfold from perfetto traces.
Test: Perfetto trace after unfolding
Bug: 292472402
Change-Id: I7a037d9a129deb4bfe4310fdba664b87164ef2ca
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 6df9aab..e912fa9 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -725,18 +725,23 @@
@Override
protected void onHandleConfigurationChanged() {
- if (!initDeviceProfile(mDeviceProfile.inv)) {
- return;
+ Trace.beginSection("Launcher#onHandleconfigurationChanged");
+ try {
+ if (!initDeviceProfile(mDeviceProfile.inv)) {
+ return;
+ }
+
+ dispatchDeviceProfileChanged();
+ reapplyUi();
+ mDragLayer.recreateControllers();
+
+ // Calling onSaveInstanceState ensures that static cache used by listWidgets is
+ // initialized properly.
+ onSaveInstanceState(new Bundle());
+ mModel.rebindCallbacks();
+ } finally {
+ Trace.endSection();
}
-
- dispatchDeviceProfileChanged();
- reapplyUi();
- mDragLayer.recreateControllers();
-
- // Calling onSaveInstanceState ensures that static cache used by listWidgets is
- // initialized properly.
- onSaveInstanceState(new Bundle());
- mModel.rebindCallbacks();
}
public void onAssistantVisibilityChanged(float visibility) {