summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/com/android/dialer/precall/PreCall.java8
-rw-r--r--java/com/android/dialer/precall/PreCallAction.java3
-rw-r--r--java/com/android/dialer/precall/PreCallComponent.java9
-rw-r--r--java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java2
-rw-r--r--java/com/android/dialer/precall/impl/PreCallImpl.java5
-rw-r--r--java/com/android/dialer/precall/impl/PreCallModule.java1
6 files changed, 13 insertions, 15 deletions
diff --git a/java/com/android/dialer/precall/PreCall.java b/java/com/android/dialer/precall/PreCall.java
index 4f021f142..bd0aee58d 100644
--- a/java/com/android/dialer/precall/PreCall.java
+++ b/java/com/android/dialer/precall/PreCall.java
@@ -22,19 +22,11 @@ import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import com.android.dialer.callintent.CallIntentBuilder;
import com.android.dialer.util.DialerUtils;
-import com.google.common.collect.ImmutableList;
/** Interface to prepare a {@link CallIntentBuilder} before placing the call with telecom. */
public interface PreCall {
/**
- * @return a list of {@link PreCallAction} in execution order for the {@link PreCallCoordinator}
- * to run.
- */
- @NonNull
- ImmutableList<PreCallAction> getActions();
-
- /**
* @return a intent when started as activity, will perform the pre-call actions and then place a
* call. TODO(twyen): if all actions do not require an UI, return a intent that will place the
* call directly instead.
diff --git a/java/com/android/dialer/precall/PreCallAction.java b/java/com/android/dialer/precall/PreCallAction.java
index 9ddc6f205..298af08ee 100644
--- a/java/com/android/dialer/precall/PreCallAction.java
+++ b/java/com/android/dialer/precall/PreCallAction.java
@@ -25,6 +25,9 @@ import com.android.dialer.callintent.CallIntentBuilder;
* CallIntentBuilder} to generate full information for the call. For example, showing a dialog to
* select the phone account on a multi-SIM device, ask if RTT should be enabled, or rewrite the
* number for roaming calls.
+ *
+ * <p>UI actions are discarded when the hosting activity is paused. A new instance of the action
+ * will be created once the activity is resumed again.
*/
public interface PreCallAction {
diff --git a/java/com/android/dialer/precall/PreCallComponent.java b/java/com/android/dialer/precall/PreCallComponent.java
index 00adde56d..859eb011a 100644
--- a/java/com/android/dialer/precall/PreCallComponent.java
+++ b/java/com/android/dialer/precall/PreCallComponent.java
@@ -17,7 +17,9 @@
package com.android.dialer.precall;
import android.content.Context;
+import android.support.annotation.NonNull;
import com.android.dialer.inject.HasRootComponent;
+import com.google.common.collect.ImmutableList;
import dagger.Subcomponent;
/** Daggaer component for {@link PreCall} */
@@ -25,6 +27,13 @@ import dagger.Subcomponent;
public abstract class PreCallComponent {
public abstract PreCall getPreCall();
+ /**
+ * @return a list of {@link PreCallAction} in execution order for the {@link PreCallCoordinator}
+ * to run.
+ */
+ @NonNull
+ public abstract ImmutableList<PreCallAction> createActions();
+
public static PreCallComponent get(Context context) {
return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component())
.preCallActionsComponent();
diff --git a/java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java b/java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java
index 240549ca5..314a0a067 100644
--- a/java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java
+++ b/java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java
@@ -82,7 +82,7 @@ public class PreCallCoordinatorImpl implements PreCallCoordinator {
}
void onResume() {
- actions = PreCallComponent.get(activity).getPreCall().getActions();
+ actions = PreCallComponent.get(activity).createActions();
runNextAction();
}
diff --git a/java/com/android/dialer/precall/impl/PreCallImpl.java b/java/com/android/dialer/precall/impl/PreCallImpl.java
index 2f9b2784c..f52fa618e 100644
--- a/java/com/android/dialer/precall/impl/PreCallImpl.java
+++ b/java/com/android/dialer/precall/impl/PreCallImpl.java
@@ -39,11 +39,6 @@ public class PreCallImpl implements PreCall {
this.actions = actions;
}
- @Override
- public ImmutableList<PreCallAction> getActions() {
- return actions;
- }
-
@NonNull
@Override
public Intent buildIntent(Context context, CallIntentBuilder builder) {
diff --git a/java/com/android/dialer/precall/impl/PreCallModule.java b/java/com/android/dialer/precall/impl/PreCallModule.java
index fa78cba5c..cbdabe33c 100644
--- a/java/com/android/dialer/precall/impl/PreCallModule.java
+++ b/java/com/android/dialer/precall/impl/PreCallModule.java
@@ -38,7 +38,6 @@ public abstract class PreCallModule {
public abstract PreCall to(PreCallImpl impl);
@Provides
- @Singleton
public static ImmutableList<PreCallAction> provideActions(
DuoAction duoAction, CallingAccountSelector callingAccountSelector) {
return ImmutableList.of(