summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-06-19 17:14:21 -0700
committerYorke Lee <yorkelee@google.com>2015-06-19 17:26:56 -0700
commiteede7c1ffc76a13d91a1c7aa470d8b5fdc4f9be6 (patch)
treefb6e09c629c62777b631cd0d0a62b94d22df3610 /InCallUI
parentf3a65b2e9bcbf162aa8a715709028b2deeb2ca09 (diff)
Fix two animations when using Connection.setInitialized
STATE_NEW has no meaning within InCallUI and can confuse the internal logic. Treat it as STATE_CONNECTING for purposes of state tracking. Also, track whether the activity is visible rather than whether it is the foreground activity (by tracking onStart/onStop vs onResume/onPause). This fixes some unexpected UI transitions when a dialog (e.g. wifi-calling dialog) shows up over the InCallUI. Bug: 19217176 Change-Id: Ifa5953e27aa4ed777ed8798c628df1bdc96ed1eb
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java1
-rw-r--r--InCallUI/src/com/android/incallui/InCallActivity.java20
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java2
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 77d6117ac..caf618f7e 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -318,7 +318,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 47342956c..3d93ddc7a 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());
}
/**