diff options
| author | Tiger Huang <tigerhuang@google.com> | 2021-04-01 20:38:50 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2021-04-05 17:35:57 +0800 |
| commit | 2664c3863bfea1421460cac3e807a7a742efcb85 (patch) | |
| tree | 43dce44f699edda775f359580afdf3e89a140e7d /core/java/android/view/InsetsState.java | |
| parent | 6c63ebbb9e64dbccc563eebdd079cef549d57ac8 (diff) | |
Refine output of "dumpsys window displays/windows"
- Prints the window title instead of dumping the whole window in
InsetsSourceProvider.
- Stops printing mFakeControl, because it is the same in each
InsetsSourceProvider.
- Removes redundant blanks after '='.
- Refines indentation.
- Prints requested visibility while dumping WindowState instead of
printing the raw mRequestedInsetsState.
Fix: 184237588
Test: check the output of "dumpsys window -a"
Change-Id: I3e0ac2335c29b7f2449b890b4070c62d77ff7f7f
Diffstat (limited to 'core/java/android/view/InsetsState.java')
| -rw-r--r-- | core/java/android/view/InsetsState.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java index 3d1c8ff515c7..f487c6c61973 100644 --- a/core/java/android/view/InsetsState.java +++ b/core/java/android/view/InsetsState.java @@ -34,6 +34,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import android.annotation.IntDef; +import android.annotation.NonNull; import android.annotation.Nullable; import android.app.WindowConfiguration; import android.graphics.Insets; @@ -808,7 +809,7 @@ public class InsetsState implements Parcelable { dest.writeTypedObject(mRoundedCorners, flags); } - public static final @android.annotation.NonNull Creator<InsetsState> CREATOR = new Creator<InsetsState>() { + public static final @NonNull Creator<InsetsState> CREATOR = new Creator<InsetsState>() { public InsetsState createFromParcel(Parcel in) { return new InsetsState(in); @@ -842,5 +843,16 @@ public class InsetsState implements Parcelable { + ", mSources= { " + joiner + " }"; } + + public @NonNull String toSourceVisibilityString() { + StringJoiner joiner = new StringJoiner(", "); + for (int i = 0; i < SIZE; i++) { + InsetsSource source = mSources[i]; + if (source != null) { + joiner.add(typeToString(i) + ": " + (source.isVisible() ? "visible" : "invisible")); + } + } + return joiner.toString(); + } } |
