diff options
| author | Jorim Jaggi <jjaggi@google.com> | 2020-05-14 17:46:32 +0200 |
|---|---|---|
| committer | Jorim Jaggi <jjaggi@google.com> | 2020-05-14 17:46:32 +0200 |
| commit | cb28ae6d17d67401ae9ee84f1998d8c5b717085f (patch) | |
| tree | aac7a10f55d567c95f0a2f9e9217903f8ee3e9d4 /core/java/android/view/WindowInsets.java | |
| parent | 701957749856236419d08b979019731654d00615 (diff) | |
Add tracing for Inset animations
So we can understand better what's going on.
Bug: 156367695
Test: Systrace
Change-Id: Ic9dc2c963f70a3bb787121d33476b84bd3dc5798
Diffstat (limited to 'core/java/android/view/WindowInsets.java')
| -rw-r--r-- | core/java/android/view/WindowInsets.java | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java index aad1c60d7b7e..4d6b72f96aab 100644 --- a/core/java/android/view/WindowInsets.java +++ b/core/java/android/view/WindowInsets.java @@ -1328,30 +1328,36 @@ public final class WindowInsets { } } - static String toString(@InsetsType int type) { - switch (type) { - case STATUS_BARS: - return "statusBars"; - case NAVIGATION_BARS: - return "navigationBars"; - case CAPTION_BAR: - return "captionBar"; - case IME: - return "ime"; - case SYSTEM_GESTURES: - return "systemGestures"; - case MANDATORY_SYSTEM_GESTURES: - return "mandatorySystemGestures"; - case TAPPABLE_ELEMENT: - return "tappableElement"; - case DISPLAY_CUTOUT: - return "displayCutout"; - case WINDOW_DECOR: - return "windowDecor"; - default: - throw new IllegalArgumentException("type needs to be >= FIRST and <= LAST," - + " type=" + type); + static String toString(@InsetsType int types) { + StringBuilder result = new StringBuilder(); + if ((types & STATUS_BARS) != 0) { + result.append("statusBars |"); + } + if ((types & NAVIGATION_BARS) != 0) { + result.append("navigationBars |"); + } + if ((types & IME) != 0) { + result.append("ime |"); + } + if ((types & SYSTEM_GESTURES) != 0) { + result.append("systemGestures |"); + } + if ((types & MANDATORY_SYSTEM_GESTURES) != 0) { + result.append("mandatorySystemGestures |"); + } + if ((types & TAPPABLE_ELEMENT) != 0) { + result.append("tappableElement |"); + } + if ((types & DISPLAY_CUTOUT) != 0) { + result.append("displayCutout |"); + } + if ((types & WINDOW_DECOR) != 0) { + result.append("windowDecor |"); + } + if (result.length() > 0) { + result.delete(result.length() - 2, result.length()); } + return result.toString(); } private Type() { |
