summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-12-10 22:33:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-10 22:33:49 +0000
commit5d57be4eb299c357073f21467e8acf9ee98e9b8f (patch)
treeee45b554988420104b1f0dfd422236f2909dbe98
parent352e869582f3ad44f04bc204e9f462549e455206 (diff)
parent948ae08cd309fff87a3ffc20e27eb917c6172978 (diff)
downloadpackages_apps_InCallUI-5d57be4eb299c357073f21467e8acf9ee98e9b8f.tar.gz
packages_apps_InCallUI-5d57be4eb299c357073f21467e8acf9ee98e9b8f.tar.bz2
packages_apps_InCallUI-5d57be4eb299c357073f21467e8acf9ee98e9b8f.zip
Merge "Show error dialogs in InCallUI" into lmp-mr1-dev
-rw-r--r--src/com/android/incallui/CallList.java3
-rw-r--r--src/com/android/incallui/CircularRevealActivity.java6
-rw-r--r--src/com/android/incallui/InCallPresenter.java30
-rw-r--r--src/com/android/incallui/InCallServiceImpl.java9
4 files changed, 37 insertions, 11 deletions
diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java
index 0bbebe5b..db43b165 100644
--- a/src/com/android/incallui/CallList.java
+++ b/src/com/android/incallui/CallList.java
@@ -82,8 +82,6 @@ public class CallList implements InCallPhoneListener {
public void onCallRemoved(Phone phone, android.telecom.Call telecommCall) {
if (mCallByTelecommCall.containsKey(telecommCall)) {
Call call = mCallByTelecommCall.get(telecommCall);
- call.setState(Call.State.DISCONNECTED);
- call.setDisconnectCause(new DisconnectCause(DisconnectCause.UNKNOWN));
if (updateCallInMap(call)) {
Log.w(this, "Removing call not previously disconnected " + call.getId());
}
@@ -420,7 +418,6 @@ public class CallList implements InCallPhoneListener {
if (call.getState() == Call.State.DISCONNECTED) {
// update existing (but do not add!!) disconnected calls
if (mCallById.containsKey(call.getId())) {
-
// For disconnected calls, we want to keep them alive for a few seconds so that the
// UI has a chance to display anything it needs when a call is disconnected.
diff --git a/src/com/android/incallui/CircularRevealActivity.java b/src/com/android/incallui/CircularRevealActivity.java
index ce6b33d3..7a9b7ccb 100644
--- a/src/com/android/incallui/CircularRevealActivity.java
+++ b/src/com/android/incallui/CircularRevealActivity.java
@@ -51,13 +51,13 @@ public class CircularRevealActivity extends Activity {
@Override
public void onReceive(Context context, Intent intent) {
clearDisplay();
- finish();
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ overridePendingTransition(0, 0);
setContentView(R.layout.outgoing_call_animation);
final Point touchPoint = getIntent().getParcelableExtra(TouchPointManager.TOUCH_POINT);
final MaterialPalette palette = getIntent().getParcelableExtra(EXTRA_THEME_COLORS);
@@ -67,6 +67,9 @@ public class CircularRevealActivity extends Activity {
@Override
protected void onStart() {
super.onStart();
+ if (!InCallPresenter.getInstance().isServiceBound()) {
+ clearDisplay();
+ }
final IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_CLEAR_DISPLAY);
LocalBroadcastManager.getInstance(this).registerReceiver(mClearDisplayReceiver, filter);
@@ -133,6 +136,7 @@ public class CircularRevealActivity extends Activity {
private void clearDisplay() {
getWindow().getDecorView().setVisibility(View.INVISIBLE);
+ finish();
}
@Override
diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java
index a12e5ea6..898772e6 100644
--- a/src/com/android/incallui/InCallPresenter.java
+++ b/src/com/android/incallui/InCallPresenter.java
@@ -166,6 +166,11 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
private boolean mShowDialpadOnStart = false;
+ /**
+ * Whether or not InCallService is bound to Telecom.
+ */
+ private boolean mServiceBound = false;
+
private Phone mPhone;
private Handler mHandler = new Handler();
@@ -914,11 +919,12 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
// This is different from the incoming call sequence because we do not need to shock the
// user with a top-level notification. Just show the call UI normally.
final boolean mainUiNotVisible = !isShowingInCallUi() || !getCallCardFragmentVisible();
- final boolean showCallUi = InCallState.OUTGOING == newState && mainUiNotVisible;
+ boolean showCallUi = InCallState.OUTGOING == newState && mainUiNotVisible;
- // TODO: Can we be suddenly in a call without it having been in the outgoing or incoming
- // state? I havent seen that but if it can happen, the code below should be enabled.
- // showCallUi |= (InCallState.INCALL && !isActivityStarted());
+ // Direct transition from PENDING_OUTGOING -> INCALL means that there was an error in the
+ // outgoing call process, so the UI should be brought up to show an error dialog.
+ showCallUi |= (InCallState.PENDING_OUTGOING == mInCallState
+ && InCallState.INCALL == newState && !isActivityStarted());
// The only time that we have an instance of mInCallActivity and it isn't started is
// when it is being destroyed. In that case, lets avoid bringing up another instance of
@@ -1087,10 +1093,24 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
mShowDialpadOnStart = false;
}
});
-
+ } else if (!mServiceBound) {
+ CircularRevealActivity.sendClearDisplayBroadcast(mContext);
+ return;
}
}
+ public void onServiceBind() {
+ mServiceBound = true;
+ }
+
+ public void onServiceUnbind() {
+ mServiceBound = false;
+ }
+
+ public boolean isServiceBound() {
+ return mServiceBound;
+ }
+
public void maybeStartRevealAnimation(Intent intent) {
if (intent == null || mInCallActivity != null) {
return;
diff --git a/src/com/android/incallui/InCallServiceImpl.java b/src/com/android/incallui/InCallServiceImpl.java
index d413370e..17f4e174 100644
--- a/src/com/android/incallui/InCallServiceImpl.java
+++ b/src/com/android/incallui/InCallServiceImpl.java
@@ -57,9 +57,14 @@ public class InCallServiceImpl extends InCallService {
getApplicationContext(),
CallList.getInstance(),
AudioModeProvider.getInstance());
-
+ InCallPresenter.getInstance().onServiceBind();
InCallPresenter.getInstance().maybeStartRevealAnimation(intent);
-
return super.onBind(intent);
}
+
+ @Override
+ public boolean onUnbind(Intent intent) {
+ InCallPresenter.getInstance().onServiceUnbind();
+ return super.onUnbind(intent);
+ }
}