mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Refactor dbus linked devices interface
Export a separate dbus object for each device
This commit is contained in:
parent
1548ce9c79
commit
778adacb80
8 changed files with 157 additions and 38 deletions
|
@ -120,7 +120,10 @@ public class DaemonCommand implements MultiLocalCommand {
|
|||
private Thread run(
|
||||
DBusConnection conn, String objectPath, Manager m, OutputWriter outputWriter, boolean ignoreAttachments
|
||||
) throws DBusException {
|
||||
conn.exportObject(new DbusSignalImpl(m, objectPath));
|
||||
final var signal = new DbusSignalImpl(m, conn, objectPath);
|
||||
conn.exportObject(signal);
|
||||
final var initThread = new Thread(signal::initObjects);
|
||||
initThread.start();
|
||||
|
||||
logger.info("Exported dbus object: " + objectPath);
|
||||
|
||||
|
@ -136,6 +139,11 @@ public class DaemonCommand implements MultiLocalCommand {
|
|||
logger.warn("Receiving messages failed, retrying", e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
initThread.join();
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
signal.close();
|
||||
});
|
||||
|
||||
thread.start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue