~canonical-platform-qa/ubuntu-system-tests/fix-wizard-reporting-page

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/helpers/ofono/__init__.py

  • Committer: Richard Huddie
  • Date: 2015-11-11 15:49:51 UTC
  • mfrom: (242.1.14 trunk)
  • Revision ID: richard.huddie@canonical.com-20151111154951-9ns0e6x0vfkma041
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
    if is_sim_inserted():
220
220
        bus = dbus.SystemBus()
221
221
        for ril_modem, properties in _get_all_modems(bus):
222
 
            if not _get_registered_status_for_modem(bus, ril_modem):
 
222
            if (_sim_present(bus, ril_modem, properties) and
 
223
               not _get_registered_status_for_modem(bus, ril_modem)):
223
224
                return False
224
225
        return True
225
226
    return False
306
307
    details = subprocess.check_output(['mc-tool', 'show', account_name],
307
308
                                      universal_newlines=True)
308
309
    return [line for line in details.splitlines()]
 
310
 
 
311
 
 
312
def end_call():
 
313
    """Programmatically end all ongoing calls."""
 
314
    bus = dbus.SystemBus()
 
315
    for path, properties in _get_all_modems(bus):
 
316
        if 'org.ofono.VoiceCallManager' in properties['Interfaces']:
 
317
            mgr = dbus.Interface(
 
318
                bus.get_object('org.ofono', path),
 
319
                'org.ofono.VoiceCallManager')
 
320
            for call_path, properties in mgr.GetCalls():
 
321
                subprocess.call(
 
322
                    ['/usr/share/ofono/scripts/hangup-call', call_path])