From d06de8235438ac3b45af381dbf93b83f0fb8460e Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 19 Mar 2015 15:02:26 -0700 Subject: Don't add multiple instances of CircularRevealFragment Certain calls can propagate state changes immediately after the call is made, causing InCallActivity.internalResolveIntent to be called twice in succession. If multiple animations are run the UI is left in an inconsistent state. Bug: 19842284 Change-Id: Ie6060a37d2bd7775731e0e82019bb8baf0ffd834 --- InCallUI/src/com/android/incallui/CircularRevealFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/CircularRevealFragment.java b/InCallUI/src/com/android/incallui/CircularRevealFragment.java index c2821792b..f8cc424fe 100644 --- a/InCallUI/src/com/android/incallui/CircularRevealFragment.java +++ b/InCallUI/src/com/android/incallui/CircularRevealFragment.java @@ -48,8 +48,13 @@ public class CircularRevealFragment extends Fragment { public static void startCircularReveal(FragmentManager fm, Point touchPoint, OnCircularRevealCompleteListener listener) { - fm.beginTransaction().add(R.id.main, new CircularRevealFragment(touchPoint, listener), TAG) - .commitAllowingStateLoss(); + if (fm.findFragmentByTag(TAG) == null) { + fm.beginTransaction().add(R.id.main, + new CircularRevealFragment(touchPoint, listener), TAG) + .commitAllowingStateLoss(); + } else { + Log.w(TAG, "An instance of CircularRevealFragment already exists"); + } } public static void endCircularReveal(FragmentManager fm) { -- cgit v1.2.3