summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2014-01-31 15:17:23 -0600
committerDenis Kenzior <denkenz@gmail.com>2014-10-20 13:40:28 -0500
commitfb1b213e22d27f07b5757eea9f082a9c7a9c2ec2 (patch)
treec19685f9819edea766bc2e55ac0f720d086bceb1
parentd3560b3784ac9bbe57bdbe0cc86e64b9a87b0ce0 (diff)
downloadofono-fb1b213e22d27f07b5757eea9f082a9c7a9c2ec2.tar.bz2
test: Add test/set-ddr
Script to set DistractedDrivingReduction property
-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])))