summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xtest/set-ddr21
2 files changed, 23 insertions, 1 deletions
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])))