Lines Matching refs:mGSMPhone

44     private GSMPhone mGSMPhone;
75 mGSMPhone = mGSMTestHandler.getGSMPhone();
79 mGSMPhone.registerForPreciseCallStateChanged(mHandler, EVENT_PHONE_STATE_CHANGED, null);
80 mGSMPhone.registerForNewRingingConnection(mHandler, EVENT_RINGING, null);
81 mGSMPhone.registerForDisconnect(mHandler, EVENT_DISCONNECT, null);
83 mGSMPhone.setOnPostDialCharacter(mHandler, EVENT_POST_DIAL, null);
85 mGSMPhone.registerForSuppServiceNotification(mHandler, EVENT_SSN, null);
86 mGSMPhone.registerForMmiInitiate(mHandler, EVENT_MMI_INITIATE, null);
87 mGSMPhone.registerForMmiComplete(mHandler, EVENT_MMI_COMPLETE, null);
88 mGSMPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
90 mGSMPhone.registerForServiceStateChanged(mHandler, SERVICE_STATE_CHANGED, null);
107 mGSMPhone.unregisterForPreciseCallStateChanged(mHandler);
108 mGSMPhone.unregisterForNewRingingConnection(mHandler);
109 mGSMPhone.unregisterForDisconnect(mHandler);
110 mGSMPhone.setOnPostDialCharacter(mHandler, 0, null);
111 mGSMPhone.unregisterForSuppServiceNotification(mHandler);
112 mGSMPhone.unregisterForMmiInitiate(mHandler);
113 mGSMPhone.unregisterForMmiComplete(mHandler);
115 mGSMPhone = null;
142 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
143 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
144 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
145 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
147 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
148 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
149 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
151 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
152 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
153 assertFalse(mGSMPhone.canConference());
159 mGSMPhone.dial("+13125551212");
161 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
166 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
167 assertEquals(Call.State.DIALING, mGSMPhone.getForegroundCall().getState());
168 assertTrue(mGSMPhone.getForegroundCall().isDialingOrAlerting());
172 } while (mGSMPhone.getForegroundCall().getConnections().size() == 0);*/
174 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
175 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
176 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
178 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
180 mGSMPhone.getForegroundCall().getState());
181 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
183 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
184 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
186 cn = mGSMPhone.getForegroundCall().getConnections().get(0);
192 assertFalse(mGSMPhone.canConference());
201 while (mGSMPhone.getForegroundCall().getState() != Call.State.ALERTING);
203 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
204 assertTrue(mGSMPhone.getForegroundCall().isDialingOrAlerting());
206 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
207 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
208 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
210 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
211 assertEquals(Call.State.ALERTING, mGSMPhone.getForegroundCall().getState());
212 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
214 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
215 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
217 cn = mGSMPhone.getForegroundCall().getConnections().get(0);
220 assertFalse(mGSMPhone.canConference());
228 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
230 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
231 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
233 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
234 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
235 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
237 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
238 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
239 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
241 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
242 assertTrue(mGSMPhone.getForegroundCall().getEarliestConnectTime() > 0);
244 cn = mGSMPhone.getForegroundCall().getConnections().get(0);
247 assertFalse(mGSMPhone.canConference());
250 mGSMPhone.getForegroundCall().hangup();
255 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
256 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
258 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
259 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
260 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
262 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
263 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
264 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
266 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
267 assertTrue(mGSMPhone.getForegroundCall().getEarliestConnectTime() > 0);
269 assertFalse(mGSMPhone.canConference());
271 cn = mGSMPhone.getForegroundCall().getEarliestConnection();
277 mGSMPhone.clearDisconnected();
279 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
280 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
282 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
283 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
284 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
286 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
287 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
288 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
290 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
291 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
293 assertFalse(mGSMPhone.canConference());
306 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
307 assertTrue(mGSMPhone.getRingingCall().isRinging());
312 assertEquals(mGSMPhone.getRingingCall(), cn.getCall());
314 assertEquals(1, mGSMPhone.getRingingCall().getConnections().size());
315 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
316 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
318 assertEquals(Call.State.INCOMING, mGSMPhone.getRingingCall().getState());
319 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
320 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
322 assertTrue(mGSMPhone.getRingingCall().getEarliestCreateTime() > 0);
323 assertEquals(0, mGSMPhone.getRingingCall().getEarliestConnectTime());
325 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
326 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
328 cn = mGSMPhone.getRingingCall().getConnections().get(0);
332 assertFalse(mGSMPhone.canConference());
335 mGSMPhone.acceptCall();
339 } while (mGSMPhone.getRingingCall().getConnections().size() == 1);
341 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
342 assertFalse(mGSMPhone.getRingingCall().isRinging());
344 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
345 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
346 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
348 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
350 mGSMPhone.getForegroundCall().getState());
351 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
353 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
354 assertTrue(mGSMPhone.getForegroundCall().getEarliestConnectTime() > 0);
356 cn = mGSMPhone.getForegroundCall().getConnections().get(0);
360 assertFalse(mGSMPhone.canConference());
366 conn = mGSMPhone.getForegroundCall().getConnections().get(0);
376 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
377 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
378 assertFalse(mGSMPhone.getRingingCall().isRinging());
380 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
381 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
382 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
384 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
386 mGSMPhone.getForegroundCall().getState());
387 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
389 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
390 assertTrue(mGSMPhone.getForegroundCall().getEarliestConnectTime() > 0);
392 cn = mGSMPhone.getForegroundCall().getEarliestConnection();
398 assertFalse(mGSMPhone.canConference());
402 mGSMPhone.clearDisconnected();
404 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
405 assertFalse(mGSMPhone.getRingingCall().isRinging());
408 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
409 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
411 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
412 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
413 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
415 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
416 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
417 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
419 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
420 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
422 assertFalse(mGSMPhone.canConference());
434 } while (mGSMPhone.getRingingCall().getConnections().isEmpty());
436 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
437 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
438 assertTrue(mGSMPhone.getRingingCall().isRinging());
440 assertEquals(1, mGSMPhone.getRingingCall().getConnections().size());
441 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
442 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
444 assertEquals(Call.State.INCOMING, mGSMPhone.getRingingCall().getState());
445 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
446 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
448 assertTrue(mGSMPhone.getRingingCall().getEarliestCreateTime() > 0);
449 assertEquals(0, mGSMPhone.getRingingCall().getEarliestConnectTime());
451 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
452 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
454 assertFalse(mGSMPhone.canConference());
457 mGSMPhone.rejectCall();
461 } while (mGSMPhone.getState() != PhoneConstants.State.IDLE);
463 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
464 assertFalse(mGSMPhone.getRingingCall().isRinging());
466 assertEquals(1, mGSMPhone.getRingingCall().getConnections().size());
467 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
468 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
470 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getRingingCall().getState());
471 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
472 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
474 assertTrue(mGSMPhone.getRingingCall().getEarliestCreateTime() > 0);
475 assertEquals(0, mGSMPhone.getRingingCall().getEarliestConnectTime());
477 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
478 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
480 cn = mGSMPhone.getRingingCall().getEarliestConnection();
485 assertFalse(mGSMPhone.canConference());
489 mGSMPhone.clearDisconnected();
492 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
493 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
495 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
496 assertEquals(0, mGSMPhone.getForegroundCall().getConnections().size());
497 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
499 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
500 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
501 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
503 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestCreateTime());
504 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
506 assertFalse(mGSMPhone.canConference());
515 } while (mGSMPhone.getRingingCall().getConnections().isEmpty());
517 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
518 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
519 assertTrue(mGSMPhone.getRingingCall().isRinging());
521 cn = mGSMPhone.getRingingCall().getEarliestConnection();
529 } while (mGSMPhone.getState() != PhoneConstants.State.IDLE);
539 } while (mGSMPhone.getState() != PhoneConstants.State.RINGING);
542 cn = mGSMPhone.getRingingCall().getEarliestConnection();
545 mGSMPhone.acceptCall();
549 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
551 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
552 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
555 mGSMPhone.switchHoldingAndActive();
559 } while (mGSMPhone.getBackgroundCall().getState() == Call.State.IDLE);
562 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
563 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
566 mGSMPhone.switchHoldingAndActive();
571 while (mGSMPhone.getBackgroundCall().getState() == Call.State.HOLDING);
573 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
574 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
582 } while (mGSMPhone.getState() != PhoneConstants.State.IDLE);
584 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
593 } while (mGSMPhone.getState() != PhoneConstants.State.RINGING);
595 mGSMPhone.rejectCall();
605 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
606 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getRingingCall().getState());
614 } while (mGSMPhone.getState() != PhoneConstants.State.RINGING);
616 cn = mGSMPhone.getRingingCall().getEarliestConnection();
618 mGSMPhone.acceptCall();
622 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
625 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
626 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
629 mGSMPhone.getForegroundCall().hangup();
637 } while (mGSMPhone.getForegroundCall().getState()
647 mGSMPhone.dial("+13125551212");
651 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
653 assertTrue(mGSMPhone.getForegroundCall().isDialingOrAlerting());
662 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
664 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
672 } while (mGSMPhone.getState() != PhoneConstants.State.RINGING);
674 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
675 assertTrue(mGSMPhone.getRingingCall().isRinging());
678 mGSMPhone.acceptCall();
682 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
684 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
686 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
687 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
688 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
689 assertTrue(mGSMPhone.canConference());
692 mGSMPhone.conference();
696 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
698 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
700 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
701 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
702 assertTrue(mGSMPhone.getForegroundCall().isMultiparty());
703 assertFalse(mGSMPhone.canConference());
706 mGSMPhone.switchHoldingAndActive();
711 while (mGSMPhone.getBackgroundCall().getState() != Call.State.HOLDING);
713 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
714 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
715 assertTrue(mGSMPhone.getBackgroundCall().isMultiparty());
716 assertFalse(mGSMPhone.canConference());
724 } while (mGSMPhone.getState() != PhoneConstants.State.RINGING);
726 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
727 assertTrue(mGSMPhone.getRingingCall().isRinging());
729 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
730 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
731 assertTrue(mGSMPhone.getBackgroundCall().isMultiparty());
732 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
733 assertFalse(mGSMPhone.canConference());
736 mGSMPhone.getBackgroundCall().hangup();
740 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.DISCONNECTED);
742 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
743 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getBackgroundCall().getState());
745 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
746 assertTrue(mGSMPhone.getRingingCall().isRinging());
749 mGSMPhone.rejectCall();
753 } while (mGSMPhone.getState() != PhoneConstants.State.IDLE);
755 assertFalse(mGSMPhone.getForegroundCall().isDialingOrAlerting());
756 assertFalse(mGSMPhone.getRingingCall().isRinging());
769 Connection cn = mGSMPhone.dial("+13125551212");
773 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
777 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
778 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
779 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
781 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
782 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
783 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
785 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
786 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
796 mGSMPhone.dial("+13125551212");
801 while (mGSMPhone.getForegroundCall().getState() != Call.State.DIALING);
803 cn = mGSMPhone.getForegroundCall().getEarliestConnection();
805 mGSMPhone.getForegroundCall().hangup();
809 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
811 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
815 mGSMPhone.dial("+13125551212");
819 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
826 while (mGSMPhone.getForegroundCall().getState() != Call.State.ALERTING);
828 cn = mGSMPhone.getForegroundCall().getEarliestConnection();
830 mGSMPhone.getForegroundCall().hangup();
835 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
837 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
845 cn = mGSMPhone.dial("+13125551212");
853 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
855 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
858 mGSMPhone.getForegroundCall().getEarliestConnection().getDisconnectCause());
862 mGSMPhone.dial("+13125551212");
866 } while (mGSMPhone.getForegroundCall().getConnections().isEmpty());
872 mGSMPhone.clearDisconnected();
873 } while (!mGSMPhone.getForegroundCall().getConnections().isEmpty());
880 mGSMPhone.dial("+13125551212");
885 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
887 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
888 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
897 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
898 assertTrue(mGSMPhone.getRingingCall().isRinging());
899 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
900 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
901 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
905 mGSMPhone.handleInCallMmiCommands("0");
909 } while (mGSMPhone.getRingingCall().getState() == Call.State.WAITING);
911 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
912 assertFalse(mGSMPhone.getRingingCall().isRinging());
913 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getRingingCall().getState());
914 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
915 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
918 mGSMPhone.switchHoldingAndActive();
922 } while (mGSMPhone.getBackgroundCall().getState() == Call.State.IDLE);
925 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
926 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
930 mGSMPhone.handleInCallMmiCommands("0");
934 } while (mGSMPhone.getBackgroundCall().getState() == Call.State.HOLDING);
936 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
937 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
938 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getBackgroundCall().getState());
945 mGSMPhone.dial("+13125551212");
950 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
952 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
953 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
964 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
965 assertTrue(mGSMPhone.getRingingCall().isRinging());
966 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
967 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
968 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
973 mGSMPhone.handleInCallMmiCommands("1");
977 } while (mGSMPhone.getRingingCall().getState() == Call.State.WAITING);
979 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
980 assertFalse(mGSMPhone.getRingingCall().isRinging());
981 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
982 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
984 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
987 mGSMPhone.switchHoldingAndActive();
991 } while (mGSMPhone.getBackgroundCall().getState() == Call.State.IDLE);
993 assertEquals(Call.State.IDLE, mGSMPhone.getForegroundCall().getState());
994 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
998 mGSMPhone.handleInCallMmiCommands("1");
1002 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
1004 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
1005 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1006 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1008 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1018 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
1019 assertTrue(mGSMPhone.getRingingCall().isRinging());
1020 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
1021 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1022 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1026 mGSMPhone.handleInCallMmiCommands("12");
1030 } while (mGSMPhone.getForegroundCall().getState() == Call.State.ACTIVE);
1032 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
1033 assertTrue(mGSMPhone.getRingingCall().isRinging());
1034 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
1035 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1036 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1038 mGSMPhone.acceptCall();
1042 } while (mGSMPhone.getState() != PhoneConstants.State.OFFHOOK);
1044 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
1045 assertFalse(mGSMPhone.getRingingCall().isRinging());
1046 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
1047 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1048 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1052 mGSMPhone.dial("+13125551212");
1057 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE ||
1058 mGSMPhone.getBackgroundCall().getState() != Call.State.HOLDING);
1060 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1061 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1069 mGSMPhone.handleInCallMmiCommands("11");
1077 mGSMPhone.handleInCallMmiCommands("12");
1081 } while (mGSMPhone.getForegroundCall().getState() == Call.State.ACTIVE);
1083 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1084 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1088 mGSMPhone.handleInCallMmiCommands("1");
1092 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
1094 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
1095 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1096 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1098 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1102 mGSMPhone.handleInCallMmiCommands("11");
1106 } while (mGSMPhone.getForegroundCall().getState() == Call.State.ACTIVE);
1108 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1109 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1116 mGSMPhone.dial("13125551212");
1121 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1123 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1124 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1133 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
1134 assertTrue(mGSMPhone.getRingingCall().isRinging());
1135 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
1136 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1137 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1143 mGSMPhone.handleInCallMmiCommands("2");
1147 } while (mGSMPhone.getRingingCall().getState() == Call.State.WAITING);
1150 assertFalse(mGSMPhone.getRingingCall().isRinging());
1151 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
1152 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
1154 mGSMPhone.getForegroundCall().getState());
1156 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1157 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1159 mGSMPhone.getBackgroundCall().getConnections().get(0).getAddress());
1162 mGSMPhone.handleInCallMmiCommands("2");
1167 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1169 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1170 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1172 mGSMPhone.getBackgroundCall().getConnections().get(0).getAddress());
1175 mGSMPhone.conference();
1179 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
1181 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1182 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1183 assertEquals(2, mGSMPhone.getForegroundCall().getConnections().size());
1192 mGSMPhone.handleInCallMmiCommands("23");
1200 mGSMPhone.handleInCallMmiCommands("21");
1204 } while (mGSMPhone.getBackgroundCall().getState() == Call.State.IDLE);
1206 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1208 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1209 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1211 mGSMPhone.getBackgroundCall().getConnections().get(0).getAddress());
1216 mGSMPhone.dial("13125551212");
1221 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1223 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1224 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1227 mGSMPhone.dial("18005551212");
1232 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1234 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1235 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1237 mGSMPhone.handleInCallMmiCommands("3");
1241 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
1243 assertEquals(PhoneConstants.State.OFFHOOK, mGSMPhone.getState());
1244 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1246 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1248 mGSMPhone.getForegroundCall().getConnections().get(1).getAddress());
1249 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1256 mGSMPhone.dial("16505550100");
1261 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1263 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1264 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1271 mGSMPhone.dial(number);
1276 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1278 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1279 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1281 if (mGSMPhone.getBackgroundCall().getConnections().size() >= 5) {
1285 mGSMPhone.conference();
1289 } while (mGSMPhone.getBackgroundCall().getState() != Call.State.IDLE);
1291 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1292 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1295 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1297 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1298 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1307 assertEquals(PhoneConstants.State.RINGING, mGSMPhone.getState());
1308 assertTrue(mGSMPhone.getRingingCall().isRinging());
1309 assertEquals(Call.State.WAITING, mGSMPhone.getRingingCall().getState());
1310 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1311 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1314 mGSMPhone.getBackgroundCall().hangup();
1315 mGSMPhone.acceptCall();
1319 } while (mGSMPhone.getRingingCall().getState() != Call.State.IDLE);
1321 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1323 mGSMPhone.getForegroundCall().getConnections().get(0).getAddress());
1324 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1326 mGSMPhone.getBackgroundCall().getConnections().get(0).getAddress());
1328 mGSMPhone.handleInCallMmiCommands("17");
1332 } while (mGSMPhone.getForegroundCall().getState() == Call.State.ACTIVE);
1334 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1335 assertEquals(Call.State.HOLDING, mGSMPhone.getBackgroundCall().getState());
1337 mGSMPhone.getBackgroundCall().getConnections().get(0).
1340 mGSMPhone.handleInCallMmiCommands("1");
1344 } while (mGSMPhone.getForegroundCall().getState() != Call.State.ACTIVE);
1346 assertEquals(Call.State.ACTIVE, mGSMPhone.getForegroundCall().getState());
1347 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1349 mGSMPhone.handleInCallMmiCommands("16");
1353 } while (mGSMPhone.getForegroundCall().getState() == Call.State.ACTIVE);
1355 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1356 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1364 mGSMPhone.dial("+13125551212,1234;5N8xx");
1478 mGSMPhone.dial("+13125551212,N");
1506 Connection cn = mGSMPhone.dial("+13125551212");
1522 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
1526 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
1527 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
1528 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
1530 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
1531 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1532 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1534 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
1535 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
1544 cn = mGSMPhone.dial("+13125551212");
1560 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
1564 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
1565 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
1566 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
1568 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
1570 mGSMPhone.getForegroundCall().getState());
1571 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1573 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
1574 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
1583 cn = mGSMPhone.dial("+13125551212");
1605 && mGSMPhone.getState() == PhoneConstants.State.IDLE));
1607 assertEquals(PhoneConstants.State.IDLE, mGSMPhone.getState());
1611 assertEquals(0, mGSMPhone.getRingingCall().getConnections().size());
1612 assertEquals(1, mGSMPhone.getForegroundCall().getConnections().size());
1613 assertEquals(0, mGSMPhone.getBackgroundCall().getConnections().size());
1615 assertEquals(Call.State.IDLE, mGSMPhone.getRingingCall().getState());
1616 assertEquals(Call.State.DISCONNECTED, mGSMPhone.getForegroundCall().getState());
1617 assertEquals(Call.State.IDLE, mGSMPhone.getBackgroundCall().getState());
1619 assertTrue(mGSMPhone.getForegroundCall().getEarliestCreateTime() > 0);
1620 assertEquals(0, mGSMPhone.getForegroundCall().getEarliestConnectTime());
1693 mGSMPhone.sendUssdResponse("## TEST: TEST_GSMPhone responding...");
1728 List mmiList = mGSMPhone.getPendingMmiCodes();
1737 mGSMPhone.dial("#646#");
1761 mGSMPhone.dial("#646#");
1763 List<? extends MmiCode> pendingMmis = mGSMPhone.getPendingMmiCodes();
1794 mGSMPhone.invokeOemRilRequestRaw(null, mHandler.obtainMessage(EVENT_OEM_RIL_MESSAGE));
1806 mGSMPhone.invokeOemRilRequestRaw(new byte[0], mHandler.obtainMessage(EVENT_OEM_RIL_MESSAGE));
1818 mGSMPhone.invokeOemRilRequestRaw("Hello".getBytes("utf-8"),
1831 mGSMPhone.invokeOemRilRequestStrings(null, mHandler.obtainMessage(EVENT_OEM_RIL_MESSAGE));
1843 mGSMPhone.invokeOemRilRequestStrings(new String[0],
1860 mGSMPhone.invokeOemRilRequestStrings(s, mHandler.obtainMessage(EVENT_OEM_RIL_MESSAGE));
1895 Connection c = mGSMPhone.dial(dialString);
1911 Connection c = mGSMPhone.dial(dialString);
1928 Connection c = mGSMPhone.dial(dialString);