From ebe298041c7d3e1c47da3b775b1851df586c3d4b Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Mon, 14 Sep 2015 13:25:29 -0700 Subject: Fix IllegalStateException in onBackPressed Check to make sure the activity is still visible before doing anything. Bug:24049732 Change-Id: I64442c9283b46ecee5972fd217fb790564671167 --- InCallUI/src/com/android/incallui/InCallActivity.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'InCallUI') diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 5fa57f9a1..1098341e3 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -239,6 +239,7 @@ 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()); @@ -399,6 +400,9 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { // BACK is also used to exit out of any "special modes" of the // in-call UI: + if (!isVisible()) { + return; + } if ((mConferenceManagerFragment == null || !mConferenceManagerFragment.isVisible()) && (mCallCardFragment == null || !mCallCardFragment.isVisible())) { -- cgit v1.2.3