diff options
author | Denis Kenzior <denkenz@gmail.com> | 2014-01-31 15:17:23 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2014-10-20 13:40:28 -0500 |
commit | fb1b213e22d27f07b5757eea9f082a9c7a9c2ec2 (patch) | |
tree | c19685f9819edea766bc2e55ac0f720d086bceb1 | |
parent | d3560b3784ac9bbe57bdbe0cc86e64b9a87b0ce0 (diff) | |
download | ofono-fb1b213e22d27f07b5757eea9f082a9c7a9c2ec2.tar.bz2 |
test: Add test/set-ddr
Script to set DistractedDrivingReduction property
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | test/set-ddr | 21 |
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]))) |