diff options
author | Chet Haase <chet@google.com> | 2013-09-13 19:01:52 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2013-09-13 19:01:52 -0700 |
commit | 5fd37236dff9ab4d605ddac873d6a353f74838b5 (patch) | |
tree | 2b143ffe20820b14e7e4b494ccf675c0d11b5a19 | |
parent | 50e5814c337f67c74d9e249cf6f67ac86dfc832d (diff) | |
download | frameworks_base-5fd37236dff9ab4d605ddac873d6a353f74838b5.zip frameworks_base-5fd37236dff9ab4d605ddac873d6a353f74838b5.tar.gz frameworks_base-5fd37236dff9ab4d605ddac873d6a353f74838b5.tar.bz2 |
Only buildLayer() on attached views
A recent change to ViewPropertyAnimator.withLayer() builds the layer
immediately after creating it. This works in general, but if the view
is not attached, buildLayer() throws an exception.
The fix is to ensure that the view is attached before calling buildLayer().
Issue #10750925 Dialer crashed and phone dropped while on call
Change-Id: I801c835a0f5cb81e159fe90c157c122cf2d0da01
-rw-r--r-- | core/java/android/view/ViewPropertyAnimator.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index 107d2c6..67a94be 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -702,7 +702,9 @@ public class ViewPropertyAnimator { @Override public void run() { mView.setLayerType(View.LAYER_TYPE_HARDWARE, null); - mView.buildLayer(); + if (mView.isAttachedToWindow()) { + mView.buildLayer(); + } } }; final int currentLayerType = mView.getLayerType(); |