waydroid_script/tools/container.py
Jami Kettunen afa0180032 container: Make missing dbus module non-fatal
This is required to properly support Waydroid tool versions <=1.3.4
(which NixOS for example still has), or 1.4.0+ configured with
USE_DBUS_ACTIVATION=0 (basically non-systemd distributions which can't
supervise the container properly when it's launched via D-Bus)
2023-03-13 13:04:26 +02:00

10 lines
435 B
Python

try:
import dbus
except ModuleNotFoundError:
pass
def DBusContainerService(object_path="/ContainerManager", intf="id.waydro.ContainerManager"):
return dbus.Interface(dbus.SystemBus().get_object("id.waydro.Container", object_path), intf)
def DBusSessionService(object_path="/SessionManager", intf="id.waydro.SessionManager"):
return dbus.Interface(dbus.SessionBus().get_object("id.waydro.Session", object_path), intf)