From 867c01eb4f077454a83e366939bca3dd03915ffc Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Fri, 25 Sep 2015 14:15:11 -0700 Subject: Use TransactionSafeActivity Remove custom visibility tracking. Bug:24294419 Change-Id: I601c9a1c14db7c53d5c7b4a0acbb41b553e10e96 --- InCallUI/src/com/android/incallui/InCallActivity.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 1098341e3..6b80fe02e 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -51,6 +51,7 @@ import android.view.accessibility.AccessibilityEvent; import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.animation.AnimationListenerAdapter; +import com.android.contacts.common.activity.TransactionSafeActivity; import com.android.contacts.common.interactions.TouchPointManager; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment; import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener; @@ -63,7 +64,7 @@ import java.util.Locale; /** * Main activity that the user interacts with while in a live call. */ -public class InCallActivity extends Activity implements FragmentDisplayManager { +public class InCallActivity extends TransactionSafeActivity implements FragmentDisplayManager { public static final String TAG = InCallActivity.class.getSimpleName(); @@ -84,7 +85,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { private ConferenceManagerFragment mConferenceManagerFragment; private FragmentManager mChildFragmentManager; - private boolean mIsVisible; private AlertDialog mDialog; /** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */ @@ -239,7 +239,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { @Override protected void onSaveInstanceState(Bundle out) { - mIsVisible = false; // TODO: The dialpad fragment should handle this as part of its own state out.putBoolean(SHOW_DIALPAD_EXTRA, mCallButtonFragment != null && mCallButtonFragment.isDialpadVisible()); @@ -254,8 +253,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { Log.d(this, "onStart()..."); super.onStart(); - mIsVisible = true; - if (mOrientationEventListener.canDetectOrientation()) { Log.v(this, "Orientation detection enabled."); mOrientationEventListener.enable(); @@ -314,7 +311,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { @Override protected void onStop() { Log.d(this, "onStop()..."); - mIsVisible = false; InCallPresenter.getInstance().updateIsChangingConfigurations(); InCallPresenter.getInstance().onActivityStopped(); mOrientationEventListener.disable(); @@ -353,10 +349,10 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { } /** - * Returns true when the Activity is currently visible (between onStart and onStop). + * Returns true when the Activity is currently visible. */ /* package */ boolean isVisible() { - return mIsVisible; + return isSafeToCommitTransactions(); } private boolean hasPendingDialogs() { -- cgit v1.2.3