diff options
author | Yorke Lee <yorkelee@google.com> | 2015-06-24 16:40:12 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-06-24 16:40:12 +0000 |
commit | 5742e705dd86ed9b4f99069070103495535d3daa (patch) | |
tree | eacc1dba36091727e9ee4f4aa3b1d7c7aeb54765 | |
parent | 338a72ae1211745f4b16cc73c5b574c4e87c5bce (diff) | |
parent | 4019d6377f7da43cd58f2435f03bd240c80aa520 (diff) |
am 4d9be45a: Merge "Fix two animations when using Connection.setInitialized" into mnc-dev
* commit '4d9be45a5df11b10a4fbb7d580f4199b5441345e':
Fix two animations when using Connection.setInitialized
-rw-r--r-- | InCallUI/src/com/android/incallui/Call.java | 1 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallActivity.java | 20 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallPresenter.java | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index da2ef3c07..ee73db2b5 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -319,7 +319,6 @@ public class Call { private static int translateState(int state) { switch (state) { case android.telecom.Call.STATE_NEW: - return Call.State.NEW; case android.telecom.Call.STATE_CONNECTING: return Call.State.CONNECTING; case android.telecom.Call.STATE_SELECT_PHONE_ACCOUNT: diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index ab7dd1b8b..b4824fb56 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -83,7 +83,7 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { private ConferenceManagerFragment mConferenceManagerFragment; private FragmentManager mChildFragmentManager; - private boolean mIsForegroundActivity; + private boolean mIsVisible; private AlertDialog mDialog; /** Use to pass 'showDialpad' from {@link #onNewIntent} to {@link #onResume} */ @@ -252,6 +252,8 @@ 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(); @@ -271,8 +273,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { Log.i(this, "onResume()..."); super.onResume(); - mIsForegroundActivity = true; - InCallPresenter.getInstance().setThemeColors(); InCallPresenter.getInstance().onUiShowing(true); @@ -298,10 +298,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { @Override protected void onPause() { Log.d(this, "onPause()..."); - super.onPause(); - - mIsForegroundActivity = false; - if (mDialpadFragment != null ) { mDialpadFragment.onDialerKeyUp(null); } @@ -310,11 +306,13 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { if (isFinishing()) { InCallPresenter.getInstance().unsetActivity(this); } + super.onPause(); } @Override protected void onStop() { Log.d(this, "onStop()..."); + mIsVisible = false; InCallPresenter.getInstance().updateIsChangingConfigurations(); InCallPresenter.getInstance().onActivityStopped(); mOrientationEventListener.disable(); @@ -353,10 +351,10 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { } /** - * Returns true when theActivity is in foreground (between onResume and onPause). + * Returns true when the Activity is currently visible (between onStart and onStop). */ - /* package */ boolean isForegroundActivity() { - return mIsForegroundActivity; + /* package */ boolean isVisible() { + return mIsVisible; } private boolean hasPendingDialogs() { @@ -791,7 +789,7 @@ public class InCallActivity extends Activity implements FragmentDisplayManager { } public void showPostCharWaitDialog(String callId, String chars) { - if (isForegroundActivity()) { + if (isVisible()) { final PostCharDialogFragment fragment = new PostCharDialogFragment(callId, chars); fragment.show(getFragmentManager(), "postCharWait"); diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 05044cb75..458f950a4 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -738,7 +738,7 @@ public class InCallPresenter implements CallList.Listener, * Returns true if the incall app is the foreground application. */ public boolean isShowingInCallUi() { - return (isActivityStarted() && mInCallActivity.isForegroundActivity()); + return (isActivityStarted() && mInCallActivity.isVisible()); } /** |