Loading src/com/android/server/telecom/CallsManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,8 @@ public class CallsManager extends Call.ListenerBase // Instance variables for testing -- we keep the latest copy of the outgoing call futures // here so that we can wait on them in tests private CompletableFuture<Call> mLatestPostSelectionProcessingFuture; private CompletableFuture<Pair<Call, List<PhoneAccountSuggestion>>> mLatestPreAccountSelectionFuture; /** * The current telecom call ID. Used when creating new instances of {@link Call}. Should Loading Loading @@ -1374,6 +1376,7 @@ public class CallsManager extends Call.ListenerBase // the account suggestion stage and the make room for call stage. CompletableFuture<Pair<Call, List<PhoneAccountSuggestion>>> preSelectStage = makeRoomForCall.thenCombine(suggestionFuture, Pair::create); mLatestPreAccountSelectionFuture = preSelectStage; // This future takes the list of suggested accounts and the call and determines if more // user interaction in the form of a phone account selection screen is needed. If so, it Loading Loading @@ -2464,6 +2467,11 @@ public class CallsManager extends Call.ListenerBase return mLatestPostSelectionProcessingFuture; } @VisibleForTesting public CompletableFuture getLatestPreAccountSelectionFuture() { return mLatestPreAccountSelectionFuture; } /** * Returns the first call that it finds with the given states. The states are treated as having * priority order so that any call with the first state will be returned before any call with Loading tests/src/com/android/server/telecom/tests/BasicCallTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,8 @@ public class BasicCallTests extends TelecomSystemTest { int startingNumCalls = mInCallServiceFixtureX.mCallById.size(); String callId = startOutgoingPhoneCallWithNoPhoneAccount("650-555-1212", mConnectionServiceFixtureA); mTelecomSystem.getCallsManager().getLatestPreAccountSelectionFuture().join(); waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); assertEquals(Call.STATE_SELECT_PHONE_ACCOUNT, mInCallServiceFixtureX.getCall(callId).getState()); assertEquals(Call.STATE_SELECT_PHONE_ACCOUNT, Loading Loading
src/com/android/server/telecom/CallsManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,8 @@ public class CallsManager extends Call.ListenerBase // Instance variables for testing -- we keep the latest copy of the outgoing call futures // here so that we can wait on them in tests private CompletableFuture<Call> mLatestPostSelectionProcessingFuture; private CompletableFuture<Pair<Call, List<PhoneAccountSuggestion>>> mLatestPreAccountSelectionFuture; /** * The current telecom call ID. Used when creating new instances of {@link Call}. Should Loading Loading @@ -1374,6 +1376,7 @@ public class CallsManager extends Call.ListenerBase // the account suggestion stage and the make room for call stage. CompletableFuture<Pair<Call, List<PhoneAccountSuggestion>>> preSelectStage = makeRoomForCall.thenCombine(suggestionFuture, Pair::create); mLatestPreAccountSelectionFuture = preSelectStage; // This future takes the list of suggested accounts and the call and determines if more // user interaction in the form of a phone account selection screen is needed. If so, it Loading Loading @@ -2464,6 +2467,11 @@ public class CallsManager extends Call.ListenerBase return mLatestPostSelectionProcessingFuture; } @VisibleForTesting public CompletableFuture getLatestPreAccountSelectionFuture() { return mLatestPreAccountSelectionFuture; } /** * Returns the first call that it finds with the given states. The states are treated as having * priority order so that any call with the first state will be returned before any call with Loading
tests/src/com/android/server/telecom/tests/BasicCallTests.java +2 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,8 @@ public class BasicCallTests extends TelecomSystemTest { int startingNumCalls = mInCallServiceFixtureX.mCallById.size(); String callId = startOutgoingPhoneCallWithNoPhoneAccount("650-555-1212", mConnectionServiceFixtureA); mTelecomSystem.getCallsManager().getLatestPreAccountSelectionFuture().join(); waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); assertEquals(Call.STATE_SELECT_PHONE_ACCOUNT, mInCallServiceFixtureX.getCall(callId).getState()); assertEquals(Call.STATE_SELECT_PHONE_ACCOUNT, Loading