Loading packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +0 −9 Original line number Diff line number Diff line Loading @@ -119,15 +119,6 @@ public class LogModule { return factory.create("ShadeLog", 500, false); } /** Provides a logging buffer for Shade height messages. */ @Provides @SysUISingleton @ShadeHeightLog public static LogBuffer provideShadeHeightLogBuffer(LogBufferFactory factory) { return factory.create("ShadeHeightLog", 500 /* maxSize */); } /** Provides a logging buffer for all logs related to managing notification sections. */ @Provides @SysUISingleton Loading packages/SystemUI/src/com/android/systemui/log/dagger/ShadeHeightLog.javadeleted 100644 → 0 +0 −33 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.log.dagger; import static java.lang.annotation.RetentionPolicy.RUNTIME; import com.android.systemui.plugins.log.LogBuffer; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import javax.inject.Qualifier; /** A {@link LogBuffer} for Shade height changes. */ @Qualifier @Documented @Retention(RUNTIME) public @interface ShadeHeightLog { } packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +0 −15 Original line number Diff line number Diff line Loading @@ -560,7 +560,6 @@ public final class NotificationPanelViewController implements Dumpable { private final KeyguardBottomAreaViewModel mKeyguardBottomAreaViewModel; private final KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor; private float mMinExpandHeight; private final ShadeHeightLogger mShadeHeightLogger; private boolean mPanelUpdateWhenAnimatorEnds; private boolean mHasVibratedOnOpen = false; private int mFixedDuration = NO_FIXED_DURATION; Loading Loading @@ -698,7 +697,6 @@ public final class NotificationPanelViewController implements Dumpable { KeyguardUpdateMonitor keyguardUpdateMonitor, MetricsLogger metricsLogger, ShadeLogger shadeLogger, ShadeHeightLogger shadeHeightLogger, ConfigurationController configurationController, Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder, StatusBarTouchableRegionManager statusBarTouchableRegionManager, Loading Loading @@ -768,7 +766,6 @@ public final class NotificationPanelViewController implements Dumpable { mLockscreenGestureLogger = lockscreenGestureLogger; mShadeExpansionStateManager = shadeExpansionStateManager; mShadeLog = shadeLogger; mShadeHeightLogger = shadeHeightLogger; mGutsManager = gutsManager; mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel; mOccludedToLockscreenTransitionViewModel = occludedToLockscreenTransitionViewModel; Loading Loading @@ -1822,7 +1819,6 @@ public final class NotificationPanelViewController implements Dumpable { waiting = true; } else { resetViews(false /* animate */); mShadeHeightLogger.logFunctionCall("collapsePanel"); setExpandedFraction(0); // just in case } if (!waiting) { Loading Loading @@ -2647,7 +2643,6 @@ public final class NotificationPanelViewController implements Dumpable { mQsController.beginJankMonitoring(isFullyCollapsed()); fling(0 /* expand */); } else { mShadeHeightLogger.logFunctionCall("expand"); setExpandedFraction(1f); } mInstantExpanding = false; Loading Loading @@ -3576,7 +3571,6 @@ public final class NotificationPanelViewController implements Dumpable { mInitialTouchFromKeyguard = mKeyguardStateController.isShowing(); if (startTracking) { mTouchSlopExceeded = true; mShadeHeightLogger.logFunctionCall("startExpandMotion"); setExpandedHeight(mInitialOffsetOnTouch); onTrackingStarted(); } Loading Loading @@ -3728,7 +3722,6 @@ public final class NotificationPanelViewController implements Dumpable { @VisibleForTesting void setExpandedHeight(float height) { debugLog("setExpandedHeight(%.1f)", height); mShadeHeightLogger.logFunctionCall("setExpandedHeight"); setExpandedHeightInternal(height); } Loading @@ -3754,13 +3747,10 @@ public final class NotificationPanelViewController implements Dumpable { return; } mShadeHeightLogger.logFunctionCall("updateExpandedHeightToMaxHeight"); setExpandedHeight(currentMaxPanelHeight); } private void setExpandedHeightInternal(float h) { mShadeHeightLogger.logSetExpandedHeightInternal(h, mSystemClock.currentTimeMillis()); if (isNaN(h)) { Log.wtf(TAG, "ExpandedHeight set to NaN"); } Loading Loading @@ -3819,7 +3809,6 @@ public final class NotificationPanelViewController implements Dumpable { /** Sets the expanded height relative to a number from 0 to 1. */ public void setExpandedFraction(float frac) { final int maxDist = getMaxPanelTransitionDistance(); mShadeHeightLogger.logFunctionCall("setExpandedFraction"); setExpandedHeight(maxDist * frac); } Loading Loading @@ -3882,7 +3871,6 @@ public final class NotificationPanelViewController implements Dumpable { /** Collapses the shade instantly without animation. */ public void instantCollapse() { abortAnimations(); mShadeHeightLogger.logFunctionCall("instantCollapse"); setExpandedFraction(0f); if (mExpanding) { notifyExpandingFinished(); Loading Loading @@ -4004,7 +3992,6 @@ public final class NotificationPanelViewController implements Dumpable { animator.getAnimatedFraction())); setOverExpansionInternal(expansion, false /* isFromGesture */); } mShadeHeightLogger.logFunctionCall("height animator update"); setExpandedHeightInternal((float) animation.getAnimatedValue()); }); return animator; Loading Loading @@ -4485,7 +4472,6 @@ public final class NotificationPanelViewController implements Dumpable { mStatusBarStateController.setUpcomingState(KEYGUARD); mStatusBarStateListener.onStateChanged(KEYGUARD); mStatusBarStateListener.onDozeAmountChanged(1f, 1f); mShadeHeightLogger.logFunctionCall("showAodUi"); setExpandedFraction(1f); } Loading Loading @@ -5058,7 +5044,6 @@ public final class NotificationPanelViewController implements Dumpable { // otherwise {@link NotificationStackScrollLayout} // wrongly enables stack height updates at the start of lockscreen swipe-up mAmbientState.setSwipingUp(h <= 0); mShadeHeightLogger.logFunctionCall("ACTION_MOVE"); setExpandedHeightInternal(newHeight); } break; Loading packages/SystemUI/src/com/android/systemui/shade/ShadeHeightLogger.ktdeleted 100644 → 0 +0 −52 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.android.systemui.shade import com.android.systemui.log.dagger.ShadeHeightLog import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogLevel.DEBUG import java.text.SimpleDateFormat import javax.inject.Inject private const val TAG = "ShadeHeightLogger" /** * Log the call stack for [NotificationPanelViewController] setExpandedHeightInternal. * * Tracking bug: b/261593829 */ class ShadeHeightLogger @Inject constructor( @ShadeHeightLog private val buffer: LogBuffer, ) { private val dateFormat = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS") fun logFunctionCall(functionName: String) { buffer.log(TAG, DEBUG, { str1 = functionName }, { "$str1" }) } fun logSetExpandedHeightInternal(h: Float, time: Long) { buffer.log(TAG, DEBUG, { double1 = h.toDouble() long1 = time }, { "setExpandedHeightInternal=$double1 time=${dateFormat.format(long1)}" }) } } No newline at end of file packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -207,7 +207,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { @Mock protected KeyguardStateController mKeyguardStateController; @Mock protected DozeLog mDozeLog; @Mock protected ShadeLogger mShadeLog; @Mock protected ShadeHeightLogger mShadeHeightLogger; @Mock protected CommandQueue mCommandQueue; @Mock protected VibratorHelper mVibratorHelper; @Mock protected LatencyTracker mLatencyTracker; Loading Loading @@ -519,7 +518,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mMetricsLogger, mShadeLog, mShadeHeightLogger, mConfigurationController, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, Loading Loading
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +0 −9 Original line number Diff line number Diff line Loading @@ -119,15 +119,6 @@ public class LogModule { return factory.create("ShadeLog", 500, false); } /** Provides a logging buffer for Shade height messages. */ @Provides @SysUISingleton @ShadeHeightLog public static LogBuffer provideShadeHeightLogBuffer(LogBufferFactory factory) { return factory.create("ShadeHeightLog", 500 /* maxSize */); } /** Provides a logging buffer for all logs related to managing notification sections. */ @Provides @SysUISingleton Loading
packages/SystemUI/src/com/android/systemui/log/dagger/ShadeHeightLog.javadeleted 100644 → 0 +0 −33 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.log.dagger; import static java.lang.annotation.RetentionPolicy.RUNTIME; import com.android.systemui.plugins.log.LogBuffer; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import javax.inject.Qualifier; /** A {@link LogBuffer} for Shade height changes. */ @Qualifier @Documented @Retention(RUNTIME) public @interface ShadeHeightLog { }
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +0 −15 Original line number Diff line number Diff line Loading @@ -560,7 +560,6 @@ public final class NotificationPanelViewController implements Dumpable { private final KeyguardBottomAreaViewModel mKeyguardBottomAreaViewModel; private final KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor; private float mMinExpandHeight; private final ShadeHeightLogger mShadeHeightLogger; private boolean mPanelUpdateWhenAnimatorEnds; private boolean mHasVibratedOnOpen = false; private int mFixedDuration = NO_FIXED_DURATION; Loading Loading @@ -698,7 +697,6 @@ public final class NotificationPanelViewController implements Dumpable { KeyguardUpdateMonitor keyguardUpdateMonitor, MetricsLogger metricsLogger, ShadeLogger shadeLogger, ShadeHeightLogger shadeHeightLogger, ConfigurationController configurationController, Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder, StatusBarTouchableRegionManager statusBarTouchableRegionManager, Loading Loading @@ -768,7 +766,6 @@ public final class NotificationPanelViewController implements Dumpable { mLockscreenGestureLogger = lockscreenGestureLogger; mShadeExpansionStateManager = shadeExpansionStateManager; mShadeLog = shadeLogger; mShadeHeightLogger = shadeHeightLogger; mGutsManager = gutsManager; mDreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel; mOccludedToLockscreenTransitionViewModel = occludedToLockscreenTransitionViewModel; Loading Loading @@ -1822,7 +1819,6 @@ public final class NotificationPanelViewController implements Dumpable { waiting = true; } else { resetViews(false /* animate */); mShadeHeightLogger.logFunctionCall("collapsePanel"); setExpandedFraction(0); // just in case } if (!waiting) { Loading Loading @@ -2647,7 +2643,6 @@ public final class NotificationPanelViewController implements Dumpable { mQsController.beginJankMonitoring(isFullyCollapsed()); fling(0 /* expand */); } else { mShadeHeightLogger.logFunctionCall("expand"); setExpandedFraction(1f); } mInstantExpanding = false; Loading Loading @@ -3576,7 +3571,6 @@ public final class NotificationPanelViewController implements Dumpable { mInitialTouchFromKeyguard = mKeyguardStateController.isShowing(); if (startTracking) { mTouchSlopExceeded = true; mShadeHeightLogger.logFunctionCall("startExpandMotion"); setExpandedHeight(mInitialOffsetOnTouch); onTrackingStarted(); } Loading Loading @@ -3728,7 +3722,6 @@ public final class NotificationPanelViewController implements Dumpable { @VisibleForTesting void setExpandedHeight(float height) { debugLog("setExpandedHeight(%.1f)", height); mShadeHeightLogger.logFunctionCall("setExpandedHeight"); setExpandedHeightInternal(height); } Loading @@ -3754,13 +3747,10 @@ public final class NotificationPanelViewController implements Dumpable { return; } mShadeHeightLogger.logFunctionCall("updateExpandedHeightToMaxHeight"); setExpandedHeight(currentMaxPanelHeight); } private void setExpandedHeightInternal(float h) { mShadeHeightLogger.logSetExpandedHeightInternal(h, mSystemClock.currentTimeMillis()); if (isNaN(h)) { Log.wtf(TAG, "ExpandedHeight set to NaN"); } Loading Loading @@ -3819,7 +3809,6 @@ public final class NotificationPanelViewController implements Dumpable { /** Sets the expanded height relative to a number from 0 to 1. */ public void setExpandedFraction(float frac) { final int maxDist = getMaxPanelTransitionDistance(); mShadeHeightLogger.logFunctionCall("setExpandedFraction"); setExpandedHeight(maxDist * frac); } Loading Loading @@ -3882,7 +3871,6 @@ public final class NotificationPanelViewController implements Dumpable { /** Collapses the shade instantly without animation. */ public void instantCollapse() { abortAnimations(); mShadeHeightLogger.logFunctionCall("instantCollapse"); setExpandedFraction(0f); if (mExpanding) { notifyExpandingFinished(); Loading Loading @@ -4004,7 +3992,6 @@ public final class NotificationPanelViewController implements Dumpable { animator.getAnimatedFraction())); setOverExpansionInternal(expansion, false /* isFromGesture */); } mShadeHeightLogger.logFunctionCall("height animator update"); setExpandedHeightInternal((float) animation.getAnimatedValue()); }); return animator; Loading Loading @@ -4485,7 +4472,6 @@ public final class NotificationPanelViewController implements Dumpable { mStatusBarStateController.setUpcomingState(KEYGUARD); mStatusBarStateListener.onStateChanged(KEYGUARD); mStatusBarStateListener.onDozeAmountChanged(1f, 1f); mShadeHeightLogger.logFunctionCall("showAodUi"); setExpandedFraction(1f); } Loading Loading @@ -5058,7 +5044,6 @@ public final class NotificationPanelViewController implements Dumpable { // otherwise {@link NotificationStackScrollLayout} // wrongly enables stack height updates at the start of lockscreen swipe-up mAmbientState.setSwipingUp(h <= 0); mShadeHeightLogger.logFunctionCall("ACTION_MOVE"); setExpandedHeightInternal(newHeight); } break; Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeHeightLogger.ktdeleted 100644 → 0 +0 −52 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.android.systemui.shade import com.android.systemui.log.dagger.ShadeHeightLog import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogLevel.DEBUG import java.text.SimpleDateFormat import javax.inject.Inject private const val TAG = "ShadeHeightLogger" /** * Log the call stack for [NotificationPanelViewController] setExpandedHeightInternal. * * Tracking bug: b/261593829 */ class ShadeHeightLogger @Inject constructor( @ShadeHeightLog private val buffer: LogBuffer, ) { private val dateFormat = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS") fun logFunctionCall(functionName: String) { buffer.log(TAG, DEBUG, { str1 = functionName }, { "$str1" }) } fun logSetExpandedHeightInternal(h: Float, time: Long) { buffer.log(TAG, DEBUG, { double1 = h.toDouble() long1 = time }, { "setExpandedHeightInternal=$double1 time=${dateFormat.format(long1)}" }) } } No newline at end of file
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -207,7 +207,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { @Mock protected KeyguardStateController mKeyguardStateController; @Mock protected DozeLog mDozeLog; @Mock protected ShadeLogger mShadeLog; @Mock protected ShadeHeightLogger mShadeHeightLogger; @Mock protected CommandQueue mCommandQueue; @Mock protected VibratorHelper mVibratorHelper; @Mock protected LatencyTracker mLatencyTracker; Loading Loading @@ -519,7 +518,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor, mMetricsLogger, mShadeLog, mShadeHeightLogger, mConfigurationController, () -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager, mConversationNotificationManager, mMediaHierarchyManager, Loading