From a1663403045248f94e88fb6d9558dc589d86114e Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Wed, 5 Feb 2020 17:10:03 +0800 Subject: Refine logic about controlling transient bars - Use copied InsetsSourceControl to prevent the leash from being released while the control gets revoked while playing transient bar animations. - Start the animation after mAnimationControl gets assigned to prevent NullPointerException. - Let SystemUI to change the bar mode to transient mode before WM plays the transient bar animation. - Remove a redundunt call to the super method. - Fix InsetsPolicyTest - Fix InsetsStateControllerTest - Fix misc things Bug: 118118435 Test: Manually swipe to show transient bars many times. Test: atest InsetsSourceProviderTest InsetsStateControllerTest InsetsPolicyTest WindowStateTests CommandQueueTest RegisterStatusBarResultTest InsetsFlagsTest LightBarControllerTest RegisterStatusBarResultTest ViewRootImplTest DisplayPolicyInsetsTests DisplayPolicyTests TaskSnapshotSurfaceTest InsetsAnimationControlImplTest Change-Id: I7d445b7dc6f47a64048937cd439bdd5ffa7fa3a3 --- core/java/android/view/InsetsSource.java | 2 +- core/java/android/view/WindowInsetsController.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/view/InsetsSource.java b/core/java/android/view/InsetsSource.java index d4961eab7473..6caa4fed6409 100644 --- a/core/java/android/view/InsetsSource.java +++ b/core/java/android/view/InsetsSource.java @@ -198,7 +198,7 @@ public class InsetsSource implements Parcelable { return "InsetsSource: {" + "mType=" + InsetsState.typeToString(mType) + ", mFrame=" + mFrame.toShortString() - + ", mVisible" + mVisible + + ", mVisible=" + mVisible + "}"; } diff --git a/core/java/android/view/WindowInsetsController.java b/core/java/android/view/WindowInsetsController.java index f501de91b3b7..ea8e73885980 100644 --- a/core/java/android/view/WindowInsetsController.java +++ b/core/java/android/view/WindowInsetsController.java @@ -16,8 +16,6 @@ package android.view; -import static android.view.WindowInsets.Type.ime; - import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -148,7 +146,7 @@ public interface WindowInsetsController { * @param types The {@link InsetsType}s the application has requested to control. * @param durationMillis Duration of animation in * {@link java.util.concurrent.TimeUnit#MILLISECONDS}, or -1 if the - * animation doesn't have a predetermined duration.T his value will be + * animation doesn't have a predetermined duration. This value will be * passed to {@link InsetsAnimation#getDurationMillis()} * @param interpolator The interpolator used for this animation, or {@code null} if this * animation doesn't follow an interpolation curve. This value will be -- cgit v1.2.3