From 028963a7b794e3f00ae22e51a9eb75c6cf78e344 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Fri, 11 Aug 2023 18:04:42 +0100 Subject: [PATCH] Adding logs to help diagnose QS disappearing in split shade Test: just logs Bug: 277909752 Change-Id: I86c81852c86104e7860a6cac69baedd2c06e7c3e --- .../shade/NotificationPanelViewController.java | 7 +++++++ .../systemui/shade/QuickSettingsController.java | 7 ++++++- .../src/com/android/systemui/shade/ShadeLogger.kt | 11 +++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 35fd98cf34c69..2673840bc151a 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2129,6 +2129,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } updateExpansionAndVisibility(); mNotificationStackScrollLayoutController.setPanelFlinging(false); + mShadeLog.d("onFlingEnd called"); // TODO(b/277909752): remove log when bug is fixed // expandImmediate should be always reset at the end of animation mQsController.setExpandImmediate(false); } @@ -2664,6 +2665,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump setListening(true); } if (mBarState != SHADE) { + // TODO(b/277909752): remove below logs when bug is fixed + mShadeLog.d("onExpandingFinished called"); + if (mSplitShadeEnabled && !mQsController.getExpanded()) { + mShadeLog.d("onExpandingFinished called before QS got expanded"); + } // updating qsExpandImmediate is done in onPanelStateChanged for unlocked shade but // on keyguard panel state is always OPEN so we need to have that extra update mQsController.setExpandImmediate(false); @@ -4714,6 +4720,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } private void onPanelStateChanged(@PanelState int state) { + mShadeLog.logPanelStateChanged(state); mQsController.updateExpansionEnabledAmbient(); if (state == STATE_OPEN && mCurrentPanelState != state) { diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java index baac57ca44bad..ac7aeae43713b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java @@ -787,6 +787,12 @@ public class QuickSettingsController implements Dumpable { /** update Qs height state */ public void setExpansionHeight(float height) { + // TODO(b/277909752): remove below log when bug is fixed + if (mSplitShadeEnabled && mShadeExpandedFraction == 1.0f && height == 0) { + Log.wtf(TAG, + "setting QS height to 0 in split shade while shade is open(ing). " + + "Value of mExpandImmediate = " + mExpandImmediate); + } int maxHeight = getMaxExpansionHeight(); height = Math.min(Math.max( height, getMinExpansionHeight()), maxHeight); @@ -933,7 +939,6 @@ public class QuickSettingsController implements Dumpable { return mShadeExpandedHeight; } - @VisibleForTesting void setExpandImmediate(boolean expandImmediate) { if (expandImmediate != mExpandImmediate) { mShadeLog.logQsExpandImmediateChanged(expandImmediate); diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt index 1c30bddfe8596..cc037ede9cb55 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt @@ -316,6 +316,17 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { ) } + fun logPanelStateChanged(@PanelState panelState: Int) { + buffer.log( + TAG, + LogLevel.VERBOSE, + { + str1 = panelState.panelStateToString() + }, + { "New panel State: $str1" } + ) + } + fun flingQs(flingType: Int, isClick: Boolean) { buffer.log( TAG,