Loading java/com/android/dialer/precall/PreCall.java +0 −8 Original line number Diff line number Diff line Loading @@ -22,18 +22,10 @@ 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 Loading java/com/android/dialer/precall/PreCallAction.java +3 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading java/com/android/dialer/precall/PreCallComponent.java +9 −0 Original line number Diff line number Diff line Loading @@ -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} */ Loading @@ -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(); Loading java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class PreCallCoordinatorImpl implements PreCallCoordinator { } void onResume() { actions = PreCallComponent.get(activity).getPreCall().getActions(); actions = PreCallComponent.get(activity).createActions(); runNextAction(); } Loading java/com/android/dialer/precall/impl/PreCallImpl.java +0 −5 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading
java/com/android/dialer/precall/PreCall.java +0 −8 Original line number Diff line number Diff line Loading @@ -22,18 +22,10 @@ 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 Loading
java/com/android/dialer/precall/PreCallAction.java +3 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading
java/com/android/dialer/precall/PreCallComponent.java +9 −0 Original line number Diff line number Diff line Loading @@ -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} */ Loading @@ -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(); Loading
java/com/android/dialer/precall/impl/PreCallCoordinatorImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class PreCallCoordinatorImpl implements PreCallCoordinator { } void onResume() { actions = PreCallComponent.get(activity).getPreCall().getActions(); actions = PreCallComponent.get(activity).createActions(); runNextAction(); } Loading
java/com/android/dialer/precall/impl/PreCallImpl.java +0 −5 Original line number Diff line number Diff line Loading @@ -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) { Loading