Home | History | Annotate | Download | only in car

Lines Matching refs:ad

27 def dial_number(log, ad, uri):
32 ad: android device object
41 ad.serial, uri))
44 ad.droid.telecomStartListeningForCallAdded()
46 ad.droid.telecomCallTelUri(uri)
50 event = ad.ed.pop_event(
59 ad.droid.telecomStopListeningForCallAdded()
62 log.info("Call ID: {} dev {}".format(call_id, ad.serial))
67 if not wait_for_dialing(log, ad):
72 def wait_for_call_state(log, ad, call_id, state):
77 ad: android device object
86 ad.droid.telecomCallStartListeningForEvent(
90 if ad.droid.telecomCallGetCallState(call_id) == state:
92 call_id, state, ad.serial))
97 event = ad.ed.pop_event(
103 state, ad.serial))
106 ad.droid.telecomCallStopListeningForEvent(call_id,
110 def hangup_call(log, ad, call_id):
115 ad: android device object
122 ad.serial, call_id))
124 if not ad.droid.telecomIsInCall():
125 log.info("We are not in-call {}".format(ad.serial))
129 ad.droid.telecomStartListeningForCallRemoved()
132 ad.droid.telecomCallDisconnect(call_id)
137 event = ad.ed.pop_event(
144 ad.droid.telecomStopListeningForCallRemoved()
152 def wait_for_not_in_call(log, ad):
157 ad: android device object
162 ad.droid.telecomStartListeningForCallRemoved()
164 calls = ad.droid.telecomCallGetCallIds()
171 calls, ad.serial))
174 event = ad.ed.pop_event(
179 or len(ad.droid.telecomCallGetCallIds() == 0)):
185 ad.serial))
188 ad.droid.telecomStopListeningForCallRemoved()
192 return (not ad.droid.telecomIsInCall())
194 def wait_for_dialing(log, ad):
199 ad: android device object
205 ad.droid.telecomStartListeningForCallAdded()
209 calls_in_state = get_calls_in_states(log, ad,
217 event = ad.ed.pop_event(
225 ad.droid.telecomStopListeningForCallAdded()
232 log.info("call id {} droid {}".format(call_id, ad.serial))
234 log, ad, call_id, tel_defines.CALL_STATE_DIALING)
238 log, ad, call_id, tel_defines.CALL_STATE_DIALING) != \
247 log.info("wait_for_dialing returns " + str(ad.droid.telecomIsInCall()) +
248 " " + str(ad.serial))
249 return ad.droid.telecomIsInCall()
251 def wait_for_ringing(log, ad):
256 ad: android device object
261 log.info("waiting for ringing {}".format(ad.serial))
263 ad.droid.telecomStartListeningForCallAdded()
266 if ad.droid.telecomIsInCall():
267 log.info("Device already in call {}".format(ad.serial))
268 ad.droid.telecomStopListeningForCallAdded()
273 calls_in_state = ad.droid.telecomCallGetCallIds()
278 event = ad.ed.pop_event(
284 ad.serial))
287 ad.droid.telecomStopListeningForCallAdded()
290 call_id, ad.serial))
297 log, ad, call_id, tel_defines.CALL_STATE_RINGING) != \
300 call_id, ad.serial))
304 def get_calls_in_states(log, ad, call_states):
309 ad: android device object
316 call_ids = ad.droid.telecomCallGetCallIds()
319 call = ad.droid.telecomCallGetCallById(call_id)