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
diff --git a/InCallUI/src/com/android/incallui/CircularRevealFragment.java b/InCallUI/src/com/android/incallui/CircularRevealFragment.java
index c282179..f8cc424 100644
--- a/InCallUI/src/com/android/incallui/CircularRevealFragment.java
+++ b/InCallUI/src/com/android/incallui/CircularRevealFragment.java
@@ -48,8 +48,13 @@
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) {