diff options
| author | Robert Carr <racarr@google.com> | 2017-04-17 15:11:35 -0700 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2017-04-17 16:03:08 -0700 |
| commit | 232b5f820e38398a98791cfc3d03b4ea8307b31b (patch) | |
| tree | aebfa53bf134822778c4c35b414d2ea63f5031a5 /core/java | |
| parent | e7b581bca98569c81b0c56b09f7dadbabb7e0245 (diff) | |
DecorView: Avoid changing shadow size in Pinned Stack.
It seems at the end of the animation, sometimes we will
come to think we have focus, before we have properly
updated mStackId. This in-and-of itself seems like
somewhat of an issue...but I'm not inclined to dig too
deeply at the moment. For now just ensure a static shadow
size in the pinned stack.
Bug: 37425446
Test: Manual
Change-Id: I379f7a6de51670c90eacb52a5be5e17784be8ac5
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/policy/DecorView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index baf6db93daaf..80b6b0848a0b 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -82,6 +82,7 @@ import android.widget.PopupWindow; import static android.app.ActivityManager.StackId; import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID; +import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.StackId.PINNED_STACK_ID; import static android.app.ActivityManager.StackId.INVALID_STACK_ID; import static android.content.res.Configuration.ORIENTATION_PORTRAIT; @@ -2182,19 +2183,22 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind final boolean wasAdjustedForStack = mElevationAdjustedForStack; // Do not use a shadow when we are in resizing mode (mBackdropFrameRenderer not null) // since the shadow is bound to the content size and not the target size. - if (StackId.hasWindowShadow(mStackId) && !isResizing()) { + if ((mStackId == FREEFORM_WORKSPACE_STACK_ID) && !isResizing()) { elevation = hasWindowFocus() ? DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP : DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP; // Add a maximum shadow height value to the top level view. // Note that pinned stack doesn't have focus // so maximum shadow height adjustment isn't needed. // TODO(skuhne): Remove this if clause once b/22668382 got fixed. - if (!mAllowUpdateElevation && mStackId != PINNED_STACK_ID) { + if (!mAllowUpdateElevation) { elevation = DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP; } // Convert the DP elevation into physical pixels. elevation = dipToPx(elevation); mElevationAdjustedForStack = true; + } else if (mStackId == PINNED_STACK_ID) { + elevation = dipToPx(DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP); + mElevationAdjustedForStack = true; } else { mElevationAdjustedForStack = false; } |
