summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Krahn <dkrahn@google.com>2015-12-16 13:44:09 -0800
committerDarren Krahn <dkrahn@google.com>2015-12-16 13:44:09 -0800
commit9d49114d0a581869ab32e1d04b03807a6152db4b (patch)
tree8920d7f3855538a666ddeb10fde7d146d184dde3
parent5cb93f016cff70190b89577ca3e8416ce3fd888a (diff)
downloadtpm-9d49114d0a581869ab32e1d04b03807a6152db4b.tar.gz
trunks: Configure D-Bus for Brillo.
Trunks is expected to move to binder on Brillo but until that work completes it will use D-Bus. BUG=25360556 Change-Id: Ie8a078d53fb71b43cec7ac5be2784ae6202a9b57
-rw-r--r--trunks/com.android.Trunks.conf15
-rw-r--r--trunks/dbus_interface.h6
2 files changed, 21 insertions, 0 deletions
diff --git a/trunks/com.android.Trunks.conf b/trunks/com.android.Trunks.conf
new file mode 100644
index 0000000..67e7f3e
--- /dev/null
+++ b/trunks/com.android.Trunks.conf
@@ -0,0 +1,15 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy user="system">
+ <allow own="com.android.Trunks" />
+ </policy>
+
+ <policy context="default">
+ <allow send_destination="com.android.Trunks" />
+ <!-- introspection denied -->
+ <deny send_destination="com.android.Trunks"
+ send_interface="org.freedesktop.DBus.Introspectable" />
+ </policy>
+</busconfig>
diff --git a/trunks/dbus_interface.h b/trunks/dbus_interface.h
index ab67506..e438683 100644
--- a/trunks/dbus_interface.h
+++ b/trunks/dbus_interface.h
@@ -19,9 +19,15 @@
namespace trunks {
+#ifdef __ANDROID__
+constexpr char kTrunksInterface[] = "com.android.Trunks";
+constexpr char kTrunksServicePath[] = "/com/android/Trunks";
+constexpr char kTrunksServiceName[] = "com.android.Trunks";
+#else
constexpr char kTrunksInterface[] = "org.chromium.Trunks";
constexpr char kTrunksServicePath[] = "/org/chromium/Trunks";
constexpr char kTrunksServiceName[] = "org.chromium.Trunks";
+#endif
// Methods exported by trunks.
constexpr char kSendCommand[] = "SendCommand";