summaryrefslogtreecommitdiff
path: root/core/java/android/view/InsetsState.java
diff options
context:
space:
mode:
authorTiger Huang <tigerhuang@google.com>2020-08-03 16:13:59 +0800
committerTiger Huang <tigerhuang@google.com>2020-08-18 20:23:59 +0800
commita15c8443354c7b049efe716e3f41258c712ea166 (patch)
treee483b89649a68c53776865213df8ceba00e7f5fd /core/java/android/view/InsetsState.java
parenta8a2aa7765895c601a33d9ed425d19b6dac39960 (diff)
Refine system bar position restoring
The previous logic restores the system bar as long as its insets source is visible. There can be a timing issue that if the user swipes to show transient bars while an immersive app just becomes the control target but the hide-bar info haven't sent to WM yet, WM will re-show the bar incorrectly. This CL uses the requested visibility and the behavior to decide if we should restore the postion and the visibility. This CL also refines and caches the arguments of showTransient. In this way, we don't have to create the array every time while invoking that method. Fix: 161247175 Test: atest InsetsPolicyTest Change-Id: Idef314dfe6625399b88b3dacb4c74c7071453497
Diffstat (limited to 'core/java/android/view/InsetsState.java')
-rw-r--r--core/java/android/view/InsetsState.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java
index 6b0b509932a8..593b37af26ad 100644
--- a/core/java/android/view/InsetsState.java
+++ b/core/java/android/view/InsetsState.java
@@ -60,6 +60,8 @@ import java.util.StringJoiner;
*/
public class InsetsState implements Parcelable {
+ public static final InsetsState EMPTY = new InsetsState();
+
/**
* Internal representation of inset source types. This is different from the public API in
* {@link WindowInsets.Type} as one type from the public API might indicate multiple windows