From: Denis Kenzior Date: Fri, 31 Jan 2014 21:17:23 +0000 (-0600) Subject: test: Add test/set-ddr X-Git-Tag: 1.16~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb1b213e22d27f07b5757eea9f082a9c7a9c2ec2;p=platform%2Fupstream%2Fofono.git test: Add test/set-ddr Script to set DistractedDrivingReduction property --- diff --git a/Makefile.am b/Makefile.am index c85ce172..42b21365 100644 --- a/Makefile.am +++ b/Makefile.am @@ -665,7 +665,8 @@ test_scripts = test/backtrace \ test/hangup-multiparty \ test/hangup-call \ test/display-icon \ - test/set-msisdn + test/set-msisdn \ + test/set-ddr if TEST testdir = $(pkglibdir)/test diff --git a/test/set-ddr b/test/set-ddr new file mode 100755 index 00000000..5d061b95 --- /dev/null +++ b/test/set-ddr @@ -0,0 +1,21 @@ +#!/usr/bin/python + +import sys +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + +modems = manager.GetModems() + +for path, properties in modems: + if "org.ofono.Handsfree" not in properties["Interfaces"]: + continue + + handsfree = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.Handsfree') + + handsfree.SetProperty("DistractedDrivingReduction",\ + dbus.Boolean(int(sys.argv[1])))