X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/d248f249e37f7b35a3b7dd69f2a06af8eddd3996..65ff7a43db16e16b95e5c6bba2853e4072a4fae6:/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java diff --git a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java index df21d94d..7faf87e8 100644 --- a/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java +++ b/src/main/java/org/asamk/signal/dbus/DbusManagerImpl.java @@ -42,6 +42,7 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -50,7 +51,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -392,12 +392,12 @@ public class DbusManagerImpl implements Manager { } @Override - public void deleteRecipient(final RecipientIdentifier.Single recipient) throws IOException { + public void deleteRecipient(final RecipientIdentifier.Single recipient) { signal.deleteRecipient(recipient.getIdentifier()); } @Override - public void deleteContact(final RecipientIdentifier.Single recipient) throws IOException { + public void deleteContact(final RecipientIdentifier.Single recipient) { signal.deleteContact(recipient.getIdentifier()); } @@ -494,11 +494,11 @@ public class DbusManagerImpl implements Manager { @Override public void receiveMessages( - final long timeout, final TimeUnit unit, final ReceiveMessageHandler handler + final Duration timeout, final ReceiveMessageHandler handler ) throws IOException { addReceiveHandler(handler); try { - Thread.sleep(unit.toMillis(timeout)); + Thread.sleep(timeout.toMillis()); } catch (InterruptedException ignored) { } removeReceiveHandler(handler); @@ -614,7 +614,7 @@ public class DbusManagerImpl implements Manager { } @Override - public void close() throws IOException { + public void close() { synchronized (this) { this.notify(); } @@ -665,9 +665,9 @@ public class DbusManagerImpl implements Manager { return string == null ? "" : string; } - private T getRemoteObject(final DBusPath devicePath, final Class type) { + private T getRemoteObject(final DBusPath path, final Class type) { try { - return connection.getRemoteObject(DbusConfig.getBusname(), devicePath.getPath(), type); + return connection.getRemoteObject(DbusConfig.getBusname(), path.getPath(), type); } catch (DBusException e) { throw new AssertionError(e); }