diff options
4 files changed, 81 insertions, 17 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt b/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt index 90ecb466b5d0..de82ca014722 100644 --- a/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt +++ b/packages/SystemUI/src/com/android/systemui/DisplayCutoutBaseView.kt @@ -37,6 +37,8 @@ import android.view.View import androidx.annotation.VisibleForTesting import com.android.systemui.RegionInterceptingFrameLayout.RegionInterceptableView import com.android.systemui.animation.Interpolators +import com.android.systemui.util.asIndenting +import java.io.PrintWriter /** * A class that handles common actions of display cutout view. @@ -324,4 +326,18 @@ open class DisplayCutoutBaseView : View, RegionInterceptableView { } } } + + open fun dump(pw: PrintWriter) { + val ipw = pw.asIndenting() + ipw.increaseIndent() + ipw.println("DisplayCutoutBaseView:") + ipw.increaseIndent() + ipw.println("shouldDrawCutout=$shouldDrawCutout") + ipw.println("cutout=${displayInfo.displayCutout}") + ipw.println("cameraProtectionProgress=$cameraProtectionProgress") + ipw.println("protectionRect=$protectionRect") + ipw.println("protectionRectOrig=$protectionRectOrig") + ipw.decreaseIndent() + ipw.decreaseIndent() + } } diff --git a/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt b/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt index 54939fdb78fb..179eb391af4e 100644 --- a/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt +++ b/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt @@ -37,6 +37,8 @@ import com.android.settingslib.Utils import com.android.systemui.animation.Interpolators import com.android.systemui.log.ScreenDecorationsLogger import com.android.systemui.plugins.statusbar.StatusBarStateController +import com.android.systemui.util.asIndenting +import java.io.PrintWriter import java.util.concurrent.Executor /** @@ -416,4 +418,15 @@ class FaceScanningOverlay( path.transform(scaleMatrix) } } + + override fun dump(pw: PrintWriter) { + val ipw = pw.asIndenting() + ipw.increaseIndent() + ipw.println("FaceScanningOverlay:") + super.dump(ipw) + ipw.println("rimProgress=$rimProgress") + ipw.println("rimRect=$rimRect") + ipw.println("this=$this") + ipw.decreaseIndent() + } } diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt b/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt index a74f2f8a5e34..99dd6b6cd673 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorHwcLayer.kt @@ -40,6 +40,8 @@ import android.view.RoundedCorner import android.view.RoundedCorners import android.view.Surface import androidx.annotation.VisibleForTesting +import com.android.systemui.util.asIndenting +import java.io.PrintWriter import kotlin.math.ceil import kotlin.math.floor @@ -47,8 +49,8 @@ import kotlin.math.floor * When the HWC of the device supports Composition.DISPLAY_DECORATION, we use this layer to draw * screen decorations. */ -class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDecorationSupport) - : DisplayCutoutBaseView(context) { +class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDecorationSupport) : + DisplayCutoutBaseView(context) { val colorMode: Int private val useInvertedAlphaColor: Boolean private val color: Int @@ -406,6 +408,20 @@ class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDec invalidate() } + override fun dump(pw: PrintWriter) { + val ipw = pw.asIndenting() + ipw.increaseIndent() + ipw.println("ScreenDecorHwcLayer:") + super.dump(pw) + ipw.println("this=$this") + ipw.println("transparentRect=$transparentRect") + ipw.println("hasTopRoundedCorner=$hasTopRoundedCorner") + ipw.println("hasBottomRoundedCorner=$hasBottomRoundedCorner") + ipw.println("roundedCornerTopSize=$roundedCornerTopSize") + ipw.println("roundedCornerBottomSize=$roundedCornerBottomSize") + ipw.decreaseIndent() + } + companion object { private val DEBUG_COLOR = ScreenDecorations.DEBUG_COLOR } diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index fb655884d949..adc04128a93a 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -23,6 +23,8 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; +import static com.android.systemui.util.DumpUtilsKt.asIndenting; + import android.annotation.IdRes; import android.annotation.NonNull; import android.annotation.Nullable; @@ -44,6 +46,7 @@ import android.os.SystemProperties; import android.os.Trace; import android.provider.Settings.Secure; import android.util.DisplayUtils; +import android.util.IndentingPrintWriter; import android.util.Log; import android.util.Size; import android.view.Display; @@ -1005,39 +1008,55 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { pw.println("ScreenDecorations state:"); - pw.println(" DEBUG_DISABLE_SCREEN_DECORATIONS:" + DEBUG_DISABLE_SCREEN_DECORATIONS); + IndentingPrintWriter ipw = asIndenting(pw); + ipw.increaseIndent(); + ipw.println("DEBUG_DISABLE_SCREEN_DECORATIONS:" + DEBUG_DISABLE_SCREEN_DECORATIONS); if (DEBUG_DISABLE_SCREEN_DECORATIONS) { return; } - pw.println(" mIsPrivacyDotEnabled:" + isPrivacyDotEnabled()); - pw.println(" shouldOptimizeOverlayVisibility:" + shouldOptimizeVisibility()); + ipw.println("mIsPrivacyDotEnabled:" + isPrivacyDotEnabled()); + ipw.println("shouldOptimizeOverlayVisibility:" + shouldOptimizeVisibility()); final boolean supportsShowingFaceScanningAnim = mFaceScanningFactory.getHasProviders(); - pw.println(" supportsShowingFaceScanningAnim:" + supportsShowingFaceScanningAnim); + ipw.println("supportsShowingFaceScanningAnim:" + supportsShowingFaceScanningAnim); if (supportsShowingFaceScanningAnim) { - pw.println(" canShowFaceScanningAnim:" + ipw.increaseIndent(); + ipw.println("canShowFaceScanningAnim:" + mFaceScanningFactory.canShowFaceScanningAnim()); - pw.println(" shouldShowFaceScanningAnim (at time dump was taken):" + ipw.println("shouldShowFaceScanningAnim (at time dump was taken):" + mFaceScanningFactory.shouldShowFaceScanningAnim()); + ipw.decreaseIndent(); + } + FaceScanningOverlay faceScanningOverlay = + (FaceScanningOverlay) getOverlayView(mFaceScanningViewId); + if (faceScanningOverlay != null) { + faceScanningOverlay.dump(ipw); } - pw.println(" mPendingConfigChange:" + mPendingConfigChange); + ipw.println("mPendingConfigChange:" + mPendingConfigChange); if (mHwcScreenDecorationSupport != null) { - pw.println(" mHwcScreenDecorationSupport:"); - pw.println(" format=" + ipw.increaseIndent(); + ipw.println("mHwcScreenDecorationSupport:"); + ipw.increaseIndent(); + ipw.println("format=" + PixelFormat.formatToString(mHwcScreenDecorationSupport.format)); - pw.println(" alphaInterpretation=" + ipw.println("alphaInterpretation=" + alphaInterpretationToString(mHwcScreenDecorationSupport.alphaInterpretation)); + ipw.decreaseIndent(); + ipw.decreaseIndent(); } else { - pw.println(" mHwcScreenDecorationSupport: null"); + ipw.increaseIndent(); + pw.println("mHwcScreenDecorationSupport: null"); + ipw.decreaseIndent(); } if (mScreenDecorHwcLayer != null) { - pw.println(" mScreenDecorHwcLayer:"); - pw.println(" transparentRegion=" + mScreenDecorHwcLayer.transparentRect); + ipw.increaseIndent(); + mScreenDecorHwcLayer.dump(ipw); + ipw.decreaseIndent(); } else { - pw.println(" mScreenDecorHwcLayer: null"); + ipw.println("mScreenDecorHwcLayer: null"); } if (mOverlays != null) { - pw.println(" mOverlays(left,top,right,bottom)=(" + ipw.println("mOverlays(left,top,right,bottom)=(" + (mOverlays[BOUNDS_POSITION_LEFT] != null) + "," + (mOverlays[BOUNDS_POSITION_TOP] != null) + "," + (mOverlays[BOUNDS_POSITION_RIGHT] != null) + "," |