From 999a45dc511ba63ea855e0be6e1fa48fb9399f4d Mon Sep 17 00:00:00 2001 From: kosyak Date: Sat, 18 May 2024 11:05:39 +0200 Subject: [PATCH] after merge imports optimiztion --- .../de/gultsch/minidns/AndroidDNSClient.java | 13 +++-- .../java/de/gultsch/minidns/DNSSocket.java | 7 ++- .../de/gultsch/minidns/NetworkDataSource.java | 13 +++-- .../java/eu/siacs/conversations/Config.java | 8 ++-- .../android/JabberIdContact.java | 8 ++-- .../conversations/crypto/OmemoSetting.java | 3 -- .../crypto/sasl/ChannelBinding.java | 8 ++-- .../crypto/sasl/SaslMechanism.java | 10 ++-- .../crypto/sasl/ScramSha256.java | 4 -- .../crypto/sasl/ScramSha512.java | 4 -- .../conversations/entities/Conversation.java | 8 +--- .../siacs/conversations/entities/Message.java | 1 - .../generator/AbstractGenerator.java | 18 +++---- .../http/HttpDownloadConnection.java | 4 +- .../medialib/activities/EditActivity.kt | 30 ++++++++++-- .../medialib/dialogs/ColorPickerDialog.kt | 11 ++++- .../dialogs/CustomAspectRatioDialog.kt | 1 - .../medialib/dialogs/ResizeDialog.kt | 6 ++- .../medialib/extensions/Activity.kt | 5 -- .../medialib/extensions/Context.kt | 10 ++-- .../medialib/extensions/EditText.kt | 5 -- .../conversations/medialib/extensions/View.kt | 1 - .../conversations/medialib/helpers/Config.kt | 2 +- .../helpers/FilterThumbnailsManager.kt | 1 - .../medialib/views/ColorPickerSquare.kt | 8 +++- .../medialib/views/EditorDrawCanvas.kt | 6 ++- .../conversations/parser/PresenceParser.java | 10 ++-- .../persistance/DatabaseBackend.java | 1 - .../services/AbstractConnectionManager.java | 4 +- .../AbstractQuickConversationsService.java | 4 +- .../services/AppRTCAudioManager.java | 8 ++-- .../services/CallIntegration.java | 14 +++--- .../CallIntegrationConnectionService.java | 22 ++++----- .../services/ChannelDiscoveryService.java | 42 ++++++++-------- .../services/MemorizingTrustManager.java | 20 ++++---- .../services/NotificationService.java | 31 ++++++------ .../services/ShortcutService.java | 1 - .../services/UnifiedPushBroker.java | 13 ++--- .../siacs/conversations/ui/AboutActivity.java | 4 +- .../AbstractSearchableListItemActivity.java | 1 - .../eu/siacs/conversations/ui/Activities.java | 1 + .../conversations/ui/BlockContactDialog.java | 1 - ...hooseAccountForProfilePictureActivity.java | 6 +-- .../ui/ChooseContactActivity.java | 1 - .../ui/ConferenceDetailsActivity.java | 7 ++- .../ui/ContactDetailsActivity.java | 8 +--- .../ui/ConversationActivity.java | 2 - .../ui/ConversationFragment.java | 21 -------- .../ui/ConversationsActivity.java | 1 - .../ui/ConversationsOverviewFragment.java | 10 ++-- .../ui/CreatePrivateGroupChatDialog.java | 1 - .../conversations/ui/EditAccountActivity.java | 15 +++--- .../conversations/ui/EnterJidDialog.java | 10 ++-- .../ui/ExtendedFabSizeChanger.java | 1 + .../ui/JoinConferenceDialog.java | 1 - .../conversations/ui/LocationActivity.java | 3 -- .../conversations/ui/MucUsersActivity.java | 2 - .../siacs/conversations/ui/OmemoActivity.java | 1 - ...ublishGroupChatProfilePictureActivity.java | 8 ++-- .../conversations/ui/RecordingActivity.java | 3 +- .../conversations/ui/RtpSessionActivity.java | 14 +----- .../siacs/conversations/ui/ScanActivity.java | 1 - .../conversations/ui/SearchActivity.java | 8 ++-- .../conversations/ui/SendLogActivity.java | 1 - .../ui/ShareLocationActivity.java | 10 ++-- .../conversations/ui/ShareWithActivity.java | 4 -- .../ui/ShowLocationActivity.java | 8 ++-- .../ui/StartConversationActivity.java | 11 ----- .../conversations/ui/TrustKeysActivity.java | 19 ++++---- .../conversations/ui/UriHandlerActivity.java | 11 ++--- .../siacs/conversations/ui/XmppActivity.java | 8 ---- .../ui/activity/SettingsActivity.java | 4 +- .../ui/adapter/AccountAdapter.java | 5 +- .../adapter/ChannelSearchResultAdapter.java | 4 +- .../ui/adapter/ConversationAdapter.java | 10 +--- .../ui/adapter/KnownHostsAdapter.java | 4 +- .../ui/adapter/ListItemAdapter.java | 4 +- .../ui/adapter/MediaAdapter.java | 12 ++--- .../ui/adapter/MediaPreviewAdapter.java | 10 +--- .../settings/BackupSettingsFragment.java | 4 +- .../settings/SecuritySettingsFragment.java | 8 ++-- .../fragment/settings/UpSettingsFragment.java | 8 ++-- .../conversations/ui/service/AudioPlayer.java | 8 ++-- .../conversations/ui/text/FixedURLSpan.java | 1 - .../conversations/ui/util/Attachment.java | 6 +-- .../ui/util/MucDetailsContextMenuHelper.java | 2 - .../conversations/ui/util/MyLinkify.java | 1 - .../ui/util/PresenceSelector.java | 2 - .../siacs/conversations/ui/util/ViewUtil.java | 3 -- .../conversations/utils/AccountUtils.java | 1 - .../conversations/utils/ExceptionHelper.java | 18 +++---- .../siacs/conversations/utils/FileUtils.java | 1 - .../utils/IrregularUnicodeDetector.java | 1 - .../siacs/conversations/utils/SSLSockets.java | 6 +-- .../conversations/utils/StylingHelper.java | 3 -- .../conversations/utils/ThemeHelper.java | 1 - .../siacs/conversations/utils/XmlHelper.java | 4 +- .../worker/ExportBackupWorker.java | 24 +++++----- .../conversations/xmpp/XmppConnection.java | 42 ---------------- .../xmpp/jingle/AbstractContentMap.java | 8 ++-- .../xmpp/jingle/AbstractJingleConnection.java | 12 ++--- .../xmpp/jingle/DirectConnectionUtils.java | 5 -- .../xmpp/jingle/FileTransferContentMap.java | 11 ++--- .../conversations/xmpp/jingle/IceServers.java | 12 ++--- .../xmpp/jingle/JingleConnectionManager.java | 26 +++++----- .../jingle/JingleFileTransferConnection.java | 48 +++++++++---------- .../xmpp/jingle/JingleRtpConnection.java | 34 ++++++------- .../xmpp/jingle/OngoingRtpSession.java | 4 +- .../xmpp/jingle/RtpCapability.java | 1 - .../xmpp/jingle/RtpContentMap.java | 16 +++---- .../xmpp/jingle/SessionDescription.java | 12 ++--- .../xmpp/jingle/ToneManager.java | 8 ++-- .../xmpp/jingle/TrackWrapper.java | 4 +- .../xmpp/jingle/WebRTCWrapper.java | 9 ++-- .../xmpp/jingle/stanzas/Content.java | 6 +-- .../stanzas/FileTransferDescription.java | 4 +- .../jingle/stanzas/IceUdpTransportInfo.java | 13 +++-- .../xmpp/jingle/stanzas/JinglePacket.java | 4 +- .../xmpp/jingle/stanzas/Reason.java | 1 - .../SocksByteStreamsTransportInfo.java | 6 +-- .../InbandBytestreamsTransport.java | 18 +++---- .../transports/SocksByteStreamsTransport.java | 22 ++++----- .../xmpp/jingle/transports/Transport.java | 6 +-- .../WebRTCDataChannelTransport.java | 20 ++++---- 124 files changed, 457 insertions(+), 618 deletions(-) diff --git a/src/main/java/de/gultsch/minidns/AndroidDNSClient.java b/src/main/java/de/gultsch/minidns/AndroidDNSClient.java index 2c3731871..b02025c59 100644 --- a/src/main/java/de/gultsch/minidns/AndroidDNSClient.java +++ b/src/main/java/de/gultsch/minidns/AndroidDNSClient.java @@ -14,19 +14,18 @@ import com.google.common.base.Strings; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; -import de.measite.minidns.AbstractDNSClient; -import de.measite.minidns.DNSMessage; -import de.measite.minidns.Record; -import de.measite.minidns.record.Data; - -import eu.siacs.conversations.Config; - import java.io.IOException; import java.net.InetAddress; import java.time.Duration; import java.util.Collections; import java.util.List; +import de.measite.minidns.AbstractDNSClient; +import de.measite.minidns.DNSMessage; +import de.measite.minidns.Record; +import de.measite.minidns.record.Data; +import eu.siacs.conversations.Config; + public class AndroidDNSClient extends AbstractDNSClient { private static final long DNS_MAX_TTL = 86_400L; diff --git a/src/main/java/de/gultsch/minidns/DNSSocket.java b/src/main/java/de/gultsch/minidns/DNSSocket.java index e3d86b80c..f2438b78a 100644 --- a/src/main/java/de/gultsch/minidns/DNSSocket.java +++ b/src/main/java/de/gultsch/minidns/DNSSocket.java @@ -7,10 +7,6 @@ import com.google.common.base.Strings; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; -import de.measite.minidns.DNSMessage; - -import eu.siacs.conversations.Config; - import org.conscrypt.OkHostnameVerifier; import java.io.Closeable; @@ -36,6 +32,9 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; +import de.measite.minidns.DNSMessage; +import eu.siacs.conversations.Config; + final class DNSSocket implements Closeable { public static final int QUERY_TIMEOUT = 5_000; diff --git a/src/main/java/de/gultsch/minidns/NetworkDataSource.java b/src/main/java/de/gultsch/minidns/NetworkDataSource.java index 67a8f8c33..3c997ec68 100644 --- a/src/main/java/de/gultsch/minidns/NetworkDataSource.java +++ b/src/main/java/de/gultsch/minidns/NetworkDataSource.java @@ -11,13 +11,6 @@ import com.google.common.cache.LoadingCache; import com.google.common.cache.RemovalListener; import com.google.common.collect.ImmutableList; -import de.measite.minidns.DNSMessage; -import de.measite.minidns.MiniDNSException; -import de.measite.minidns.source.DNSDataSource; -import de.measite.minidns.util.MultipleIoException; - -import eu.siacs.conversations.Config; - import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; @@ -28,6 +21,12 @@ import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import de.measite.minidns.DNSMessage; +import de.measite.minidns.MiniDNSException; +import de.measite.minidns.source.DNSDataSource; +import de.measite.minidns.util.MultipleIoException; +import eu.siacs.conversations.Config; + public class NetworkDataSource extends DNSDataSource { private static final LoadingCache socketCache = diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 134afdbf7..0113d90f0 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -3,15 +3,15 @@ package eu.siacs.conversations; import android.graphics.Bitmap; import android.net.Uri; -import eu.siacs.conversations.crypto.XmppDomainVerifier; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.chatstate.ChatState; - import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; +import eu.siacs.conversations.crypto.XmppDomainVerifier; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.chatstate.ChatState; + public final class Config { private static final int UNENCRYPTED = 1; private static final int OPENPGP = 2; diff --git a/src/main/java/eu/siacs/conversations/android/JabberIdContact.java b/src/main/java/eu/siacs/conversations/android/JabberIdContact.java index 32d5a53e7..4050e1b93 100644 --- a/src/main/java/eu/siacs/conversations/android/JabberIdContact.java +++ b/src/main/java/eu/siacs/conversations/android/JabberIdContact.java @@ -8,14 +8,14 @@ import android.os.Build; import android.provider.ContactsContract; import android.util.Log; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.services.QuickConversationsService; -import eu.siacs.conversations.xmpp.Jid; - import java.util.Collections; import java.util.HashMap; import java.util.Map; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.services.QuickConversationsService; +import eu.siacs.conversations.xmpp.Jid; + public class JabberIdContact extends AbstractPhoneContact { private static final String[] PROJECTION = diff --git a/src/main/java/eu/siacs/conversations/crypto/OmemoSetting.java b/src/main/java/eu/siacs/conversations/crypto/OmemoSetting.java index b173108c1..ba2d484a8 100644 --- a/src/main/java/eu/siacs/conversations/crypto/OmemoSetting.java +++ b/src/main/java/eu/siacs/conversations/crypto/OmemoSetting.java @@ -31,14 +31,11 @@ package eu.siacs.conversations.crypto; import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; import com.google.common.base.Strings; import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Message; public class OmemoSetting { diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/ChannelBinding.java b/src/main/java/eu/siacs/conversations/crypto/sasl/ChannelBinding.java index 3cbaaeeb9..03e255c5d 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/ChannelBinding.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ChannelBinding.java @@ -10,15 +10,15 @@ import com.google.common.collect.BiMap; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableBiMap; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + import eu.siacs.conversations.Config; import eu.siacs.conversations.utils.SSLSockets; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; - public enum ChannelBinding { NONE, TLS_EXPORTER, diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/SaslMechanism.java b/src/main/java/eu/siacs/conversations/crypto/sasl/SaslMechanism.java index 93c722e37..2af67c111 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/SaslMechanism.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/SaslMechanism.java @@ -6,17 +6,17 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Collections2; +import java.util.Collection; +import java.util.Collections; + +import javax.net.ssl.SSLSocket; + import eu.siacs.conversations.Config; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.utils.SSLSockets; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; -import java.util.Collection; -import java.util.Collections; - -import javax.net.ssl.SSLSocket; - public abstract class SaslMechanism { protected final Account account; diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha256.java b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha256.java index b330f1fe7..521a04198 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha256.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha256.java @@ -3,10 +3,6 @@ package eu.siacs.conversations.crypto.sasl; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; -import org.bouncycastle.crypto.Digest; -import org.bouncycastle.crypto.digests.SHA256Digest; -import org.bouncycastle.crypto.macs.HMac; - import eu.siacs.conversations.entities.Account; public class ScramSha256 extends ScramMechanism { diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha512.java b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha512.java index e6dcf2efd..40ad5f3a3 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha512.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha512.java @@ -3,10 +3,6 @@ package eu.siacs.conversations.crypto.sasl; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; -import org.bouncycastle.crypto.Digest; -import org.bouncycastle.crypto.digests.SHA512Digest; -import org.bouncycastle.crypto.macs.HMac; - import eu.siacs.conversations.entities.Account; public class ScramSha512 extends ScramMechanism { diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index f71deb695..d9a7bf1c8 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -1,5 +1,7 @@ package eu.siacs.conversations.entities; +import static eu.siacs.conversations.entities.Bookmark.printableValue; + import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; @@ -10,7 +12,6 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; import android.telephony.PhoneNumberUtils; @@ -24,7 +25,6 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.text.util.Linkify; import android.util.DisplayMetrics; -import android.util.LruCache; import android.util.Pair; import android.util.SparseArray; import android.view.Gravity; @@ -82,7 +82,6 @@ import java.time.format.FormatStyle; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Objects; @@ -111,7 +110,6 @@ import eu.siacs.conversations.databinding.CommandTextFieldBinding; import eu.siacs.conversations.databinding.CommandUnknownBinding; import eu.siacs.conversations.databinding.CommandWebviewBinding; import eu.siacs.conversations.databinding.DialogQuickeditBinding; -import eu.siacs.conversations.http.HttpConnectionManager; import eu.siacs.conversations.persistance.DatabaseBackend; import eu.siacs.conversations.services.AvatarService; import eu.siacs.conversations.services.QuickConversationsService; @@ -135,8 +133,6 @@ import eu.siacs.conversations.xmpp.stanzas.IqPacket; import io.michaelrocks.libphonenumber.android.NumberParseException; import me.saket.bettermovementmethod.BetterLinkMovementMethod; -import static eu.siacs.conversations.entities.Bookmark.printableValue; - public class Conversation extends AbstractEntity implements Blockable, Comparable, Conversational, AvatarService.Avatarable { public static final String TABLENAME = "conversations"; diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 863141338..0ff414588 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -4,7 +4,6 @@ import android.content.ContentValues; import android.database.Cursor; import android.graphics.Color; import android.text.SpannableStringBuilder; -import android.text.TextUtils; import android.util.Log; import androidx.annotation.Nullable; diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index 905b08286..539de064f 100644 --- a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java @@ -2,15 +2,6 @@ package eu.siacs.conversations.generator; import android.util.Base64; -import eu.siacs.conversations.BuildConfig; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; -import eu.siacs.conversations.crypto.axolotl.AxolotlService; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.services.XmppConnectionService; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.XmppConnection; - import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.SimpleDateFormat; @@ -21,6 +12,15 @@ import java.util.List; import java.util.Locale; import java.util.TimeZone; +import eu.siacs.conversations.BuildConfig; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.crypto.axolotl.AxolotlService; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.services.XmppConnectionService; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.XmppConnection; + public abstract class AbstractGenerator { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US); diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index 88e5f801f..5e6efee10 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -1,5 +1,7 @@ package eu.siacs.conversations.http; +import static eu.siacs.conversations.http.HttpConnectionManager.EXECUTOR; + import android.util.Log; import androidx.annotation.Nullable; @@ -33,8 +35,6 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; -import static eu.siacs.conversations.http.HttpConnectionManager.EXECUTOR; - public class HttpDownloadConnection implements Transferable { private final Message message; diff --git a/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt b/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt index 83a21498b..aa3beb9e9 100644 --- a/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt +++ b/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt @@ -33,11 +33,35 @@ import eu.siacs.conversations.medialib.adapters.FiltersAdapter import eu.siacs.conversations.medialib.dialogs.ColorPickerDialog import eu.siacs.conversations.medialib.dialogs.OtherAspectRatioDialog import eu.siacs.conversations.medialib.dialogs.ResizeDialog -import eu.siacs.conversations.medialib.extensions.* -import eu.siacs.conversations.medialib.helpers.* +import eu.siacs.conversations.medialib.extensions.applyColorFilter +import eu.siacs.conversations.medialib.extensions.beGone +import eu.siacs.conversations.medialib.extensions.beVisible +import eu.siacs.conversations.medialib.extensions.beVisibleIf +import eu.siacs.conversations.medialib.extensions.config +import eu.siacs.conversations.medialib.extensions.copyNonDimensionAttributesTo +import eu.siacs.conversations.medialib.extensions.ensureBackgroundThread +import eu.siacs.conversations.medialib.extensions.getCompressionFormat +import eu.siacs.conversations.medialib.extensions.getRealPathFromURI +import eu.siacs.conversations.medialib.extensions.isGone +import eu.siacs.conversations.medialib.extensions.isNougatPlus +import eu.siacs.conversations.medialib.extensions.isVisible +import eu.siacs.conversations.medialib.extensions.onGlobalLayout +import eu.siacs.conversations.medialib.extensions.onSeekBarChangeListener +import eu.siacs.conversations.medialib.extensions.showErrorToast +import eu.siacs.conversations.medialib.extensions.toast +import eu.siacs.conversations.medialib.helpers.ASPECT_RATIO_FOUR_THREE +import eu.siacs.conversations.medialib.helpers.ASPECT_RATIO_FREE +import eu.siacs.conversations.medialib.helpers.ASPECT_RATIO_ONE_ONE +import eu.siacs.conversations.medialib.helpers.ASPECT_RATIO_OTHER +import eu.siacs.conversations.medialib.helpers.ASPECT_RATIO_SIXTEEN_NINE +import eu.siacs.conversations.medialib.helpers.FilterThumbnailsManager +import eu.siacs.conversations.medialib.helpers.REAL_FILE_PATH import eu.siacs.conversations.medialib.models.FilterItem import eu.siacs.conversations.utils.ThemeHelper -import java.io.* +import java.io.File +import java.io.FileOutputStream +import java.io.InputStream +import java.io.OutputStream import java.lang.Float.max import java.util.UUID diff --git a/src/main/java/eu/siacs/conversations/medialib/dialogs/ColorPickerDialog.kt b/src/main/java/eu/siacs/conversations/medialib/dialogs/ColorPickerDialog.kt index 34979a54a..602ee2772 100644 --- a/src/main/java/eu/siacs/conversations/medialib/dialogs/ColorPickerDialog.kt +++ b/src/main/java/eu/siacs/conversations/medialib/dialogs/ColorPickerDialog.kt @@ -13,7 +13,16 @@ import androidx.appcompat.app.AlertDialog import com.google.android.material.dialog.MaterialAlertDialogBuilder import eu.siacs.conversations.R import eu.siacs.conversations.databinding.DialogColorPickerBinding -import eu.siacs.conversations.medialib.extensions.* +import eu.siacs.conversations.medialib.extensions.beVisible +import eu.siacs.conversations.medialib.extensions.config +import eu.siacs.conversations.medialib.extensions.copyToClipboard +import eu.siacs.conversations.medialib.extensions.isQPlus +import eu.siacs.conversations.medialib.extensions.onGlobalLayout +import eu.siacs.conversations.medialib.extensions.onTextChangeListener +import eu.siacs.conversations.medialib.extensions.setFillWithStroke +import eu.siacs.conversations.medialib.extensions.setupDialogStuff +import eu.siacs.conversations.medialib.extensions.toHex +import eu.siacs.conversations.medialib.extensions.value import eu.siacs.conversations.medialib.views.ColorPickerSquare import java.util.LinkedList diff --git a/src/main/java/eu/siacs/conversations/medialib/dialogs/CustomAspectRatioDialog.kt b/src/main/java/eu/siacs/conversations/medialib/dialogs/CustomAspectRatioDialog.kt index 1b718d3a3..785fd833f 100644 --- a/src/main/java/eu/siacs/conversations/medialib/dialogs/CustomAspectRatioDialog.kt +++ b/src/main/java/eu/siacs/conversations/medialib/dialogs/CustomAspectRatioDialog.kt @@ -3,7 +3,6 @@ package eu.siacs.conversations.medialib.dialogs import android.app.Activity import android.widget.EditText import androidx.appcompat.app.AlertDialog -import androidx.appcompat.app.AppCompatActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder import eu.siacs.conversations.R import eu.siacs.conversations.databinding.DialogCustomAspectRatioBinding diff --git a/src/main/java/eu/siacs/conversations/medialib/dialogs/ResizeDialog.kt b/src/main/java/eu/siacs/conversations/medialib/dialogs/ResizeDialog.kt index c72548d96..df715249a 100644 --- a/src/main/java/eu/siacs/conversations/medialib/dialogs/ResizeDialog.kt +++ b/src/main/java/eu/siacs/conversations/medialib/dialogs/ResizeDialog.kt @@ -7,7 +7,11 @@ import androidx.appcompat.app.AlertDialog import com.google.android.material.dialog.MaterialAlertDialogBuilder import eu.siacs.conversations.R import eu.siacs.conversations.databinding.DialogResizeImageBinding -import eu.siacs.conversations.medialib.extensions.* +import eu.siacs.conversations.medialib.extensions.onTextChangeListener +import eu.siacs.conversations.medialib.extensions.setupDialogStuff +import eu.siacs.conversations.medialib.extensions.showKeyboard +import eu.siacs.conversations.medialib.extensions.toast +import eu.siacs.conversations.medialib.extensions.value class ResizeDialog(val activity: Activity, val size: Point, val callback: (newSize: Point) -> Unit) { init { diff --git a/src/main/java/eu/siacs/conversations/medialib/extensions/Activity.kt b/src/main/java/eu/siacs/conversations/medialib/extensions/Activity.kt index 401c5fa16..61ef62772 100644 --- a/src/main/java/eu/siacs/conversations/medialib/extensions/Activity.kt +++ b/src/main/java/eu/siacs/conversations/medialib/extensions/Activity.kt @@ -3,11 +3,6 @@ package eu.siacs.conversations.medialib.extensions import android.app.Activity import android.view.View import androidx.appcompat.app.AlertDialog -import eu.siacs.conversations.R -import eu.siacs.conversations.medialib.models.FileDirItem -import java.io.File -import java.io.FileNotFoundException -import java.io.OutputStream fun Activity.setupDialogStuff( view: View, diff --git a/src/main/java/eu/siacs/conversations/medialib/extensions/Context.kt b/src/main/java/eu/siacs/conversations/medialib/extensions/Context.kt index 79d691f25..28fc030ea 100644 --- a/src/main/java/eu/siacs/conversations/medialib/extensions/Context.kt +++ b/src/main/java/eu/siacs/conversations/medialib/extensions/Context.kt @@ -1,7 +1,11 @@ package eu.siacs.conversations.medialib.extensions import android.app.Activity -import android.content.* +import android.content.ClipData +import android.content.ClipboardManager +import android.content.ContentUris +import android.content.Context +import android.content.Intent import android.media.MediaScannerConnection import android.net.Uri import android.os.Environment @@ -15,8 +19,8 @@ import eu.siacs.conversations.R import eu.siacs.conversations.medialib.helpers.Config import java.io.File import java.text.SimpleDateFormat -import java.util.* -import java.util.regex.Pattern +import java.util.Date +import java.util.Locale val Context.config: Config get() = Config.newInstance(applicationContext) diff --git a/src/main/java/eu/siacs/conversations/medialib/extensions/EditText.kt b/src/main/java/eu/siacs/conversations/medialib/extensions/EditText.kt index b63b104ad..85ddd324f 100644 --- a/src/main/java/eu/siacs/conversations/medialib/extensions/EditText.kt +++ b/src/main/java/eu/siacs/conversations/medialib/extensions/EditText.kt @@ -1,13 +1,8 @@ package eu.siacs.conversations.medialib.extensions import android.text.Editable -import android.text.Spannable -import android.text.SpannableString import android.text.TextWatcher -import android.text.style.BackgroundColorSpan import android.widget.EditText -import android.widget.TextView -import androidx.core.graphics.ColorUtils val EditText.value: String get() = text.toString().trim() diff --git a/src/main/java/eu/siacs/conversations/medialib/extensions/View.kt b/src/main/java/eu/siacs/conversations/medialib/extensions/View.kt index 91758a551..a73363bf3 100644 --- a/src/main/java/eu/siacs/conversations/medialib/extensions/View.kt +++ b/src/main/java/eu/siacs/conversations/medialib/extensions/View.kt @@ -1,6 +1,5 @@ package eu.siacs.conversations.medialib.extensions -import android.view.HapticFeedbackConstants import android.view.View import android.view.ViewTreeObserver diff --git a/src/main/java/eu/siacs/conversations/medialib/helpers/Config.kt b/src/main/java/eu/siacs/conversations/medialib/helpers/Config.kt index 04121f567..b7562a847 100644 --- a/src/main/java/eu/siacs/conversations/medialib/helpers/Config.kt +++ b/src/main/java/eu/siacs/conversations/medialib/helpers/Config.kt @@ -3,7 +3,7 @@ package eu.siacs.conversations.medialib.helpers import android.content.Context import android.graphics.Color import eu.siacs.conversations.R -import java.util.* +import java.util.LinkedList class Config(private val context: Context) { protected val prefs = context.getSharedPreferences("media_config_prefs", Context.MODE_PRIVATE) diff --git a/src/main/java/eu/siacs/conversations/medialib/helpers/FilterThumbnailsManager.kt b/src/main/java/eu/siacs/conversations/medialib/helpers/FilterThumbnailsManager.kt index 7501d1a89..390192dd7 100644 --- a/src/main/java/eu/siacs/conversations/medialib/helpers/FilterThumbnailsManager.kt +++ b/src/main/java/eu/siacs/conversations/medialib/helpers/FilterThumbnailsManager.kt @@ -2,7 +2,6 @@ package eu.siacs.conversations.medialib.helpers import android.graphics.Bitmap import eu.siacs.conversations.medialib.models.FilterItem -import java.util.* class FilterThumbnailsManager { private var filterThumbnails = ArrayList(10) diff --git a/src/main/java/eu/siacs/conversations/medialib/views/ColorPickerSquare.kt b/src/main/java/eu/siacs/conversations/medialib/views/ColorPickerSquare.kt index 9cc6d37ab..1babad6e9 100644 --- a/src/main/java/eu/siacs/conversations/medialib/views/ColorPickerSquare.kt +++ b/src/main/java/eu/siacs/conversations/medialib/views/ColorPickerSquare.kt @@ -2,7 +2,13 @@ package eu.siacs.conversations.medialib.views import android.annotation.SuppressLint import android.content.Context -import android.graphics.* +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.ComposeShader +import android.graphics.LinearGradient +import android.graphics.Paint +import android.graphics.PorterDuff +import android.graphics.Shader import android.graphics.Shader.TileMode import android.util.AttributeSet import android.view.View diff --git a/src/main/java/eu/siacs/conversations/medialib/views/EditorDrawCanvas.kt b/src/main/java/eu/siacs/conversations/medialib/views/EditorDrawCanvas.kt index 7e55ee5f3..474a52853 100644 --- a/src/main/java/eu/siacs/conversations/medialib/views/EditorDrawCanvas.kt +++ b/src/main/java/eu/siacs/conversations/medialib/views/EditorDrawCanvas.kt @@ -1,7 +1,11 @@ package eu.siacs.conversations.medialib.views import android.content.Context -import android.graphics.* +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint +import android.graphics.Path import android.util.AttributeSet import android.view.MotionEvent import android.view.View diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index e2bab7860..43c850caf 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -2,6 +2,11 @@ package eu.siacs.conversations.parser; import android.util.Log; +import org.openintents.openpgp.util.OpenPgpUtils; + +import java.util.ArrayList; +import java.util.List; + import eu.siacs.conversations.Config; import eu.siacs.conversations.crypto.PgpEngine; import eu.siacs.conversations.crypto.axolotl.AxolotlService; @@ -23,11 +28,6 @@ import eu.siacs.conversations.xmpp.OnPresencePacketReceived; import eu.siacs.conversations.xmpp.pep.Avatar; import eu.siacs.conversations.xmpp.stanzas.PresencePacket; -import org.openintents.openpgp.util.OpenPgpUtils; - -import java.util.ArrayList; -import java.util.List; - public class PresenceParser extends AbstractParser implements OnPresencePacketReceived { public PresenceParser(XmppConnectionService service) { diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java index 41ab36dff..96698e1c8 100644 --- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java @@ -34,7 +34,6 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; diff --git a/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java b/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java index 747189ff7..e1a0b490d 100644 --- a/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/services/AbstractConnectionManager.java @@ -1,5 +1,7 @@ package eu.siacs.conversations.services; +import static eu.siacs.conversations.entities.Transferable.VALID_CRYPTO_EXTENSIONS; + import android.content.Context; import android.net.ConnectivityManager; import android.net.Network; @@ -39,8 +41,6 @@ import okio.BufferedSink; import okio.Okio; import okio.Source; -import static eu.siacs.conversations.entities.Transferable.VALID_CRYPTO_EXTENSIONS; - public class AbstractConnectionManager { private static final int UI_REFRESH_THRESHOLD = 250; diff --git a/src/main/java/eu/siacs/conversations/services/AbstractQuickConversationsService.java b/src/main/java/eu/siacs/conversations/services/AbstractQuickConversationsService.java index 8f6c3c1f2..23a62ab48 100644 --- a/src/main/java/eu/siacs/conversations/services/AbstractQuickConversationsService.java +++ b/src/main/java/eu/siacs/conversations/services/AbstractQuickConversationsService.java @@ -7,10 +7,10 @@ import android.content.pm.PackageManager; import com.google.common.collect.Iterables; -import eu.siacs.conversations.BuildConfig; - import java.util.Arrays; +import eu.siacs.conversations.BuildConfig; + public abstract class AbstractQuickConversationsService { public static final String SMS_RETRIEVED_ACTION = diff --git a/src/main/java/eu/siacs/conversations/services/AppRTCAudioManager.java b/src/main/java/eu/siacs/conversations/services/AppRTCAudioManager.java index 21e2389c3..639bde1a5 100644 --- a/src/main/java/eu/siacs/conversations/services/AppRTCAudioManager.java +++ b/src/main/java/eu/siacs/conversations/services/AppRTCAudioManager.java @@ -24,10 +24,6 @@ import androidx.core.content.ContextCompat; import com.google.common.collect.ImmutableSet; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.utils.AppRTCUtils; -import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; - import org.webrtc.ThreadUtils; import java.util.HashSet; @@ -35,6 +31,10 @@ import java.util.Set; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.utils.AppRTCUtils; +import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; + /** AppRTCAudioManager manages all audio related parts of the AppRTC demo. */ public class AppRTCAudioManager { diff --git a/src/main/java/eu/siacs/conversations/services/CallIntegration.java b/src/main/java/eu/siacs/conversations/services/CallIntegration.java index 28cdb36e5..1a2859bdb 100644 --- a/src/main/java/eu/siacs/conversations/services/CallIntegration.java +++ b/src/main/java/eu/siacs/conversations/services/CallIntegration.java @@ -20,13 +20,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; -import eu.siacs.conversations.ui.util.MainThreadExecutor; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; -import eu.siacs.conversations.xmpp.jingle.Media; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -34,6 +27,13 @@ import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.ui.util.MainThreadExecutor; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.jingle.JingleConnectionManager; +import eu.siacs.conversations.xmpp.jingle.Media; + public class CallIntegration extends Connection { private static final List BROKEN_DEVICE_MODELS = diff --git a/src/main/java/eu/siacs/conversations/services/CallIntegrationConnectionService.java b/src/main/java/eu/siacs/conversations/services/CallIntegrationConnectionService.java index 95f1f6785..b2779be76 100644 --- a/src/main/java/eu/siacs/conversations/services/CallIntegrationConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/CallIntegrationConnectionService.java @@ -28,6 +28,17 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; @@ -40,17 +51,6 @@ import eu.siacs.conversations.xmpp.jingle.Media; import eu.siacs.conversations.xmpp.jingle.RtpEndUserState; import eu.siacs.conversations.xmpp.jingle.stanzas.Reason; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - public class CallIntegrationConnectionService extends ConnectionService { private static final String EXTRA_ADDRESS = "eu.siacs.conversations.address"; diff --git a/src/main/java/eu/siacs/conversations/services/ChannelDiscoveryService.java b/src/main/java/eu/siacs/conversations/services/ChannelDiscoveryService.java index 3ca6bfde4..95e4dc494 100644 --- a/src/main/java/eu/siacs/conversations/services/ChannelDiscoveryService.java +++ b/src/main/java/eu/siacs/conversations/services/ChannelDiscoveryService.java @@ -11,28 +11,6 @@ import com.google.common.base.Strings; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.crypto.TrustManagers; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.entities.Room; -import eu.siacs.conversations.http.HttpConnectionManager; -import eu.siacs.conversations.http.services.MuclumbusService; -import eu.siacs.conversations.parser.IqParser; -import eu.siacs.conversations.utils.TLSSocketFactory; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.OnIqPacketReceived; -import eu.siacs.conversations.xmpp.XmppConnection; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - -import okhttp3.OkHttpClient; -import okhttp3.ResponseBody; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; -import retrofit2.Retrofit; -import retrofit2.converter.gson.GsonConverterFactory; - import java.io.IOException; import java.security.KeyManagementException; import java.security.KeyStoreException; @@ -50,6 +28,26 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.X509TrustManager; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.crypto.TrustManagers; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Room; +import eu.siacs.conversations.http.HttpConnectionManager; +import eu.siacs.conversations.http.services.MuclumbusService; +import eu.siacs.conversations.parser.IqParser; +import eu.siacs.conversations.utils.TLSSocketFactory; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.OnIqPacketReceived; +import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; +import okhttp3.OkHttpClient; +import okhttp3.ResponseBody; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; + public class ChannelDiscoveryService { private final XmppConnectionService service; diff --git a/src/main/java/eu/siacs/conversations/services/MemorizingTrustManager.java b/src/main/java/eu/siacs/conversations/services/MemorizingTrustManager.java index d05fa4ac3..baaf0dbcd 100644 --- a/src/main/java/eu/siacs/conversations/services/MemorizingTrustManager.java +++ b/src/main/java/eu/siacs/conversations/services/MemorizingTrustManager.java @@ -48,17 +48,6 @@ import com.google.common.base.Preconditions; import com.google.common.io.ByteStreams; import com.google.common.io.CharStreams; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; -import eu.siacs.conversations.crypto.BundledTrustManager; -import eu.siacs.conversations.crypto.CombiningTrustManager; -import eu.siacs.conversations.crypto.TrustManagers; -import eu.siacs.conversations.crypto.XmppDomainVerifier; -import eu.siacs.conversations.entities.MTMDecision; -import eu.siacs.conversations.http.HttpConnectionManager; -import eu.siacs.conversations.persistance.FileBackend; -import eu.siacs.conversations.ui.MemorizingActivity; - import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -91,6 +80,15 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.crypto.TrustManagers; +import eu.siacs.conversations.crypto.XmppDomainVerifier; +import eu.siacs.conversations.entities.MTMDecision; +import eu.siacs.conversations.http.HttpConnectionManager; +import eu.siacs.conversations.persistance.FileBackend; +import eu.siacs.conversations.ui.MemorizingActivity; + /** * A X509 trust manager implementation which asks the user about invalid certificates and memorizes * their decision. diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 7027ee2cc..27dd63475 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -42,7 +42,6 @@ import androidx.core.content.ContextCompat; import androidx.core.content.pm.ShortcutInfoCompat; import androidx.core.graphics.drawable.IconCompat; -import com.google.android.material.color.MaterialColors; import com.google.common.base.Joiner; import com.google.common.base.Optional; import com.google.common.base.Splitter; @@ -51,6 +50,21 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.primitives.Ints; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; @@ -73,21 +87,6 @@ import eu.siacs.conversations.xmpp.XmppConnection; import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection; import eu.siacs.conversations.xmpp.jingle.Media; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - public class NotificationService { public static final Object CATCHUP_LOCK = new Object(); diff --git a/src/main/java/eu/siacs/conversations/services/ShortcutService.java b/src/main/java/eu/siacs/conversations/services/ShortcutService.java index 41fdbf754..8cb67cfdd 100644 --- a/src/main/java/eu/siacs/conversations/services/ShortcutService.java +++ b/src/main/java/eu/siacs/conversations/services/ShortcutService.java @@ -11,7 +11,6 @@ import android.os.Build; import android.util.Log; import androidx.annotation.NonNull; -import androidx.annotation.RequiresApi; import androidx.core.content.pm.ShortcutInfoCompat; import androidx.core.graphics.drawable.IconCompat; diff --git a/src/main/java/eu/siacs/conversations/services/UnifiedPushBroker.java b/src/main/java/eu/siacs/conversations/services/UnifiedPushBroker.java index 4aab05cee..ed54c379b 100644 --- a/src/main/java/eu/siacs/conversations/services/UnifiedPushBroker.java +++ b/src/main/java/eu/siacs/conversations/services/UnifiedPushBroker.java @@ -23,6 +23,13 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import java.nio.charset.StandardCharsets; +import java.text.ParseException; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; @@ -34,12 +41,6 @@ import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.stanzas.IqPacket; import eu.siacs.conversations.xmpp.stanzas.PresencePacket; -import java.nio.charset.StandardCharsets; -import java.text.ParseException; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; public class UnifiedPushBroker { diff --git a/src/main/java/eu/siacs/conversations/ui/AboutActivity.java b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java index 59a60f282..6f2e0d80e 100644 --- a/src/main/java/eu/siacs/conversations/ui/AboutActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java @@ -1,5 +1,7 @@ package eu.siacs.conversations.ui; +import static eu.siacs.conversations.ui.XmppActivity.configureActionBar; + import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; @@ -8,8 +10,6 @@ import eu.siacs.conversations.R; import eu.siacs.conversations.ui.util.SettingsUtils; import eu.siacs.conversations.utils.ThemeHelper; -import static eu.siacs.conversations.ui.XmppActivity.configureActionBar; - public class AboutActivity extends AppCompatActivity { @Override diff --git a/src/main/java/eu/siacs/conversations/ui/AbstractSearchableListItemActivity.java b/src/main/java/eu/siacs/conversations/ui/AbstractSearchableListItemActivity.java index 0479598f8..3ca8dd114 100644 --- a/src/main/java/eu/siacs/conversations/ui/AbstractSearchableListItemActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/AbstractSearchableListItemActivity.java @@ -9,7 +9,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; -import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; diff --git a/src/main/java/eu/siacs/conversations/ui/Activities.java b/src/main/java/eu/siacs/conversations/ui/Activities.java index d95d6b4ac..894931008 100644 --- a/src/main/java/eu/siacs/conversations/ui/Activities.java +++ b/src/main/java/eu/siacs/conversations/ui/Activities.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.res.Configuration; import android.os.Build; import android.view.View; + import com.google.android.material.elevation.SurfaceColors; public final class Activities { diff --git a/src/main/java/eu/siacs/conversations/ui/BlockContactDialog.java b/src/main/java/eu/siacs/conversations/ui/BlockContactDialog.java index 04678c3c7..013f314b9 100644 --- a/src/main/java/eu/siacs/conversations/ui/BlockContactDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/BlockContactDialog.java @@ -4,7 +4,6 @@ import android.view.View; import android.widget.Toast; import androidx.annotation.StringRes; -import androidx.appcompat.app.AlertDialog; import androidx.databinding.DataBindingUtil; import com.google.android.material.dialog.MaterialAlertDialogBuilder; diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java index 71662589c..7eca2a85d 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChooseAccountForProfilePictureActivity.java @@ -7,14 +7,14 @@ import android.widget.Toast; import androidx.databinding.DataBindingUtil; +import java.util.ArrayList; +import java.util.List; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityManageAccountsBinding; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.ui.adapter.AccountAdapter; -import java.util.ArrayList; -import java.util.List; - public class ChooseAccountForProfilePictureActivity extends XmppActivity { protected final List accountList = new ArrayList<>(); diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java index 41237f392..867381d2b 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java @@ -32,7 +32,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index dd80bf8bd..aa89614d7 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -1,5 +1,8 @@ package eu.siacs.conversations.ui; +import static eu.siacs.conversations.entities.Bookmark.printableValue; +import static eu.siacs.conversations.utils.StringUtils.changed; + import android.app.Activity; import android.app.PendingIntent; import android.content.Context; @@ -29,7 +32,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityMucDetailsBinding; import eu.siacs.conversations.entities.Account; @@ -62,9 +64,6 @@ import eu.siacs.conversations.utils.XmppUri; import eu.siacs.conversations.xmpp.Jid; import me.drakeet.support.toast.ToastCompat; -import static eu.siacs.conversations.entities.Bookmark.printableValue; -import static eu.siacs.conversations.utils.StringUtils.changed; - public class ConferenceDetailsActivity extends XmppActivity implements OnConversationUpdate, OnMucRosterUpdate, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnConfigurationPushed, XmppConnectionService.OnRoomDestroy, TextWatcher, OnMediaLoaded { public static final String ACTION_VIEW_MUC = "view_muc"; diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index a932a400b..4f934a8ef 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -7,7 +7,6 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.graphics.drawable.Drawable; import android.content.res.ColorStateList; import android.net.Uri; import android.os.Build; @@ -19,14 +18,12 @@ import android.provider.ContactsContract.Intents; import android.text.Spannable; import android.text.SpannableString; import android.text.style.RelativeSizeSpan; -import android.util.TypedValue; -import android.view.inputmethod.InputMethodManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; -import android.view.ViewGroup; +import android.view.inputmethod.InputMethodManager; import android.widget.ArrayAdapter; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; @@ -41,7 +38,6 @@ import androidx.core.view.ViewCompat; import androidx.databinding.DataBindingUtil; import com.google.android.material.color.MaterialColors; -import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; @@ -55,7 +51,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.axolotl.AxolotlService; @@ -87,7 +82,6 @@ import eu.siacs.conversations.utils.PhoneNumberUtilWrapper; import eu.siacs.conversations.utils.UIHelper; import eu.siacs.conversations.utils.XEP0392Helper; import eu.siacs.conversations.utils.XmppUri; -import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.OnKeyStatusUpdated; diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index da5231357..8e23da5bc 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -6,8 +6,6 @@ import android.os.Bundle; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; -import eu.siacs.conversations.ui.util.SettingsUtils; - public class ConversationActivity extends AppCompatActivity { @Override diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 12fcbfc52..1cde83fdd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -18,8 +18,6 @@ import android.app.FragmentManager; import android.app.PendingIntent; import android.app.ProgressDialog; import android.content.ActivityNotFoundException; -import android.content.ContentResolver; -import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -27,11 +25,9 @@ import android.content.IntentSender.SendIntentException; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; -import android.content.res.ColorStateList; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.os.Environment; import android.os.Handler; import android.os.SystemClock; import android.os.VibrationEffect; @@ -82,9 +78,6 @@ import androidx.viewpager.widget.PagerAdapter; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; -import org.jetbrains.annotations.NotNull; - -import java.net.URL; import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; @@ -93,7 +86,6 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -169,19 +161,6 @@ import eu.siacs.conversations.xmpp.jingle.Media; import eu.siacs.conversations.xmpp.jingle.OngoingRtpSession; import eu.siacs.conversations.xmpp.jingle.RtpCapability; import eu.siacs.conversations.xmpp.stanzas.IqPacket; -import eu.siacs.conversations.xmpp.jingle.RtpEndUserState; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.atomic.AtomicBoolean; public class ConversationFragment extends XmppFragment implements EditMessage.KeyboardListener, diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index 18d9313ca..b74456fa9 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -69,7 +69,6 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; import eu.siacs.conversations.Config; diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index 89f121de1..eb63a72a6 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -29,6 +29,9 @@ package eu.siacs.conversations.ui; +import static androidx.recyclerview.widget.ItemTouchHelper.LEFT; +import static androidx.recyclerview.widget.ItemTouchHelper.RIGHT; + import android.app.Activity; import android.app.AlertDialog; import android.app.Fragment; @@ -57,7 +60,6 @@ import com.google.common.base.Optional; import com.google.common.collect.Collections2; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -74,9 +76,8 @@ import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Conversational; import eu.siacs.conversations.entities.ListItem; -import eu.siacs.conversations.entities.Presence; -import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.services.QuickConversationsService; +import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.ui.adapter.ConversationAdapter; import eu.siacs.conversations.ui.interfaces.OnConversationArchived; import eu.siacs.conversations.ui.interfaces.OnConversationSelected; @@ -91,9 +92,6 @@ import eu.siacs.conversations.utils.EasyOnboardingInvite; import eu.siacs.conversations.utils.ThemeHelper; import eu.siacs.conversations.xmpp.jingle.OngoingRtpSession; -import static androidx.recyclerview.widget.ItemTouchHelper.LEFT; -import static androidx.recyclerview.widget.ItemTouchHelper.RIGHT; - public class ConversationsOverviewFragment extends XmppFragment { private static final String STATE_SCROLL_POSITION = ConversationsOverviewFragment.class.getName()+".scroll_state"; diff --git a/src/main/java/eu/siacs/conversations/ui/CreatePrivateGroupChatDialog.java b/src/main/java/eu/siacs/conversations/ui/CreatePrivateGroupChatDialog.java index ae3406a2d..a188d4e87 100644 --- a/src/main/java/eu/siacs/conversations/ui/CreatePrivateGroupChatDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/CreatePrivateGroupChatDialog.java @@ -6,7 +6,6 @@ import android.os.Bundle; import android.widget.AutoCompleteTextView; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.DialogFragment; diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 59b902d56..62726128b 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -41,6 +41,13 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputLayout; import com.google.common.base.CharMatcher; +import org.openintents.openpgp.util.OpenPgpUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; @@ -78,16 +85,8 @@ import eu.siacs.conversations.xmpp.XmppConnection; import eu.siacs.conversations.xmpp.XmppConnection.Features; import eu.siacs.conversations.xmpp.forms.Data; import eu.siacs.conversations.xmpp.pep.Avatar; - import okhttp3.HttpUrl; -import org.openintents.openpgp.util.OpenPgpUtils; - -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - public class EditAccountActivity extends OmemoActivity implements OnAccountUpdate, OnUpdateBlocklist, OnKeyStatusUpdated, OnCaptchaRequested, KeyChainAliasCallback, XmppConnectionService.OnShowErrorToast, XmppConnectionService.OnMamPreferencesFetched { diff --git a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java index f8ecfe9d6..20d76bb3a 100644 --- a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java @@ -2,8 +2,6 @@ package eu.siacs.conversations.ui; import android.app.Activity; import android.app.Dialog; -import android.content.DialogInterface.OnClickListener; -import android.content.DialogInterface; import android.os.Bundle; import android.text.Editable; import android.text.InputType; @@ -14,15 +12,14 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; -import android.widget.TextView; import android.widget.ToggleButton; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.databinding.DataBindingUtil; import androidx.fragment.app.DialogFragment; -import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.Arrays; @@ -31,21 +28,20 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import io.michaelrocks.libphonenumber.android.NumberParseException; - import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.DialogEnterJidBinding; -import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Presence; import eu.siacs.conversations.entities.ServiceDiscoveryResult; +import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.ui.adapter.KnownHostsAdapter; import eu.siacs.conversations.ui.interfaces.OnBackendConnected; import eu.siacs.conversations.ui.util.DelayedHintHelper; import eu.siacs.conversations.utils.PhoneNumberUtilWrapper; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.OnGatewayResult; +import io.michaelrocks.libphonenumber.android.NumberParseException; public class EnterJidDialog extends DialogFragment implements OnBackendConnected, TextWatcher { diff --git a/src/main/java/eu/siacs/conversations/ui/ExtendedFabSizeChanger.java b/src/main/java/eu/siacs/conversations/ui/ExtendedFabSizeChanger.java index 6c21f1a2d..3a6141f98 100644 --- a/src/main/java/eu/siacs/conversations/ui/ExtendedFabSizeChanger.java +++ b/src/main/java/eu/siacs/conversations/ui/ExtendedFabSizeChanger.java @@ -2,6 +2,7 @@ package eu.siacs.conversations.ui; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; + import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton; public class ExtendedFabSizeChanger extends RecyclerView.OnScrollListener { diff --git a/src/main/java/eu/siacs/conversations/ui/JoinConferenceDialog.java b/src/main/java/eu/siacs/conversations/ui/JoinConferenceDialog.java index 7ed3fbd9d..ad4cef1f6 100644 --- a/src/main/java/eu/siacs/conversations/ui/JoinConferenceDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/JoinConferenceDialog.java @@ -6,7 +6,6 @@ import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.widget.AutoCompleteTextView; -import android.widget.Spinner; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; diff --git a/src/main/java/eu/siacs/conversations/ui/LocationActivity.java b/src/main/java/eu/siacs/conversations/ui/LocationActivity.java index 141874b48..359df08b1 100644 --- a/src/main/java/eu/siacs/conversations/ui/LocationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/LocationActivity.java @@ -1,7 +1,6 @@ package eu.siacs.conversations.ui; import android.Manifest; -import android.annotation.TargetApi; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageManager; @@ -10,7 +9,6 @@ import android.graphics.BitmapFactory; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; -import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.Settings; @@ -39,7 +37,6 @@ import eu.siacs.conversations.services.QuickConversationsService; import eu.siacs.conversations.ui.util.LocationHelper; import eu.siacs.conversations.ui.widget.Marker; import eu.siacs.conversations.ui.widget.MyLocation; -import eu.siacs.conversations.ui.util.SettingsUtils; public abstract class LocationActivity extends ActionBarActivity implements LocationListener { protected LocationManager locationManager; diff --git a/src/main/java/eu/siacs/conversations/ui/MucUsersActivity.java b/src/main/java/eu/siacs/conversations/ui/MucUsersActivity.java index 72cad4cd0..e3de9106c 100644 --- a/src/main/java/eu/siacs/conversations/ui/MucUsersActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/MucUsersActivity.java @@ -17,11 +17,9 @@ import androidx.annotation.NonNull; import androidx.databinding.DataBindingUtil; import com.google.common.collect.Collections2; -import com.google.common.collect.Lists; import com.google.common.collect.Ordering; import java.util.ArrayList; -import java.util.Collections; import java.util.Locale; import eu.siacs.conversations.R; diff --git a/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java b/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java index ac7559769..027622b4c 100644 --- a/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/OmemoActivity.java @@ -8,7 +8,6 @@ import android.widget.CompoundButton; import android.widget.LinearLayout; import android.widget.Toast; -import androidx.appcompat.app.AlertDialog; import androidx.databinding.DataBindingUtil; import com.google.android.material.color.MaterialColors; diff --git a/src/main/java/eu/siacs/conversations/ui/PublishGroupChatProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishGroupChatProfilePictureActivity.java index 8d686c36f..fd5344ee2 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishGroupChatProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishGroupChatProfilePictureActivity.java @@ -29,6 +29,8 @@ package eu.siacs.conversations.ui; +import static eu.siacs.conversations.ui.PublishProfilePictureActivity.REQUEST_CHOOSE_PICTURE; + import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; @@ -40,6 +42,8 @@ import android.widget.Toast; import androidx.annotation.StringRes; import androidx.databinding.DataBindingUtil; +import com.canhub.cropper.CropImage; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityPublishProfilePictureBinding; @@ -47,10 +51,6 @@ import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.ui.interfaces.OnAvatarPublication; import eu.siacs.conversations.ui.util.PendingItem; -import static eu.siacs.conversations.ui.PublishProfilePictureActivity.REQUEST_CHOOSE_PICTURE; - -import com.canhub.cropper.CropImage; - public class PublishGroupChatProfilePictureActivity extends XmppActivity implements OnAvatarPublication { private final PendingItem pendingConversationUuid = new PendingItem<>(); private ActivityPublishProfilePictureBinding binding; diff --git a/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java b/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java index e4fdab63a..5f023b9c5 100644 --- a/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java @@ -23,14 +23,13 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Objects; +import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import java.util.Set; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityRecordingBinding; -import eu.siacs.conversations.ui.util.SettingsUtils; import eu.siacs.conversations.utils.ThemeHelper; import eu.siacs.conversations.utils.TimeFrameUtils; diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index f83d8a0be..faec8af61 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -1,8 +1,7 @@ package eu.siacs.conversations.ui; -import static eu.siacs.conversations.utils.PermissionUtils.getFirstDenied; - import static java.util.Arrays.asList; +import static eu.siacs.conversations.utils.PermissionUtils.getFirstDenied; import android.Manifest; import android.annotation.SuppressLint; @@ -59,7 +58,6 @@ import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.services.CallIntegration; import eu.siacs.conversations.services.CallIntegrationConnectionService; import eu.siacs.conversations.services.XmppConnectionService; -import eu.siacs.conversations.ui.widget.DialpadView; import eu.siacs.conversations.ui.util.AvatarWorkerTask; import eu.siacs.conversations.ui.util.MainThreadExecutor; import eu.siacs.conversations.ui.util.Rationals; @@ -75,16 +73,6 @@ import eu.siacs.conversations.xmpp.jingle.OngoingRtpSession; import eu.siacs.conversations.xmpp.jingle.RtpCapability; import eu.siacs.conversations.xmpp.jingle.RtpEndUserState; -import org.webrtc.RendererCommon; -import org.webrtc.SurfaceViewRenderer; -import org.webrtc.VideoTrack; - -import java.lang.ref.WeakReference; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Set; - public class RtpSessionActivity extends XmppActivity implements XmppConnectionService.OnJingleRtpConnectionUpdate, eu.siacs.conversations.ui.widget.SurfaceViewRenderer.OnAspectRatioChanged { diff --git a/src/main/java/eu/siacs/conversations/ui/ScanActivity.java b/src/main/java/eu/siacs/conversations/ui/ScanActivity.java index 983f21dc8..196dec28b 100644 --- a/src/main/java/eu/siacs/conversations/ui/ScanActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ScanActivity.java @@ -61,7 +61,6 @@ import java.util.Map; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.ui.service.CameraManager; -import eu.siacs.conversations.ui.util.SettingsUtils; import eu.siacs.conversations.ui.widget.ScannerView; import eu.siacs.conversations.utils.ThemeHelper; diff --git a/src/main/java/eu/siacs/conversations/ui/SearchActivity.java b/src/main/java/eu/siacs/conversations/ui/SearchActivity.java index e78ff1534..2296fcf56 100644 --- a/src/main/java/eu/siacs/conversations/ui/SearchActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SearchActivity.java @@ -29,6 +29,9 @@ package eu.siacs.conversations.ui; +import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.hideSoftKeyboard; +import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.showKeyboard; + import android.app.PendingIntent; import android.content.Intent; import android.os.Bundle; @@ -44,7 +47,6 @@ import android.widget.AdapterView; import android.widget.EditText; import android.widget.Toast; -import androidx.core.content.ContextCompat; import androidx.databinding.DataBindingUtil; import com.google.android.material.color.MaterialColors; @@ -71,10 +73,6 @@ import eu.siacs.conversations.ui.util.PendingItem; import eu.siacs.conversations.ui.util.ShareUtil; import eu.siacs.conversations.utils.FtsUtils; import eu.siacs.conversations.utils.MessageUtils; -import eu.siacs.conversations.utils.UIHelper; - -import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.hideSoftKeyboard; -import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.showKeyboard; public class SearchActivity extends XmppActivity implements TextWatcher, OnSearchResultsAvailable, MessageAdapter.OnContactPictureClicked { diff --git a/src/main/java/eu/siacs/conversations/ui/SendLogActivity.java b/src/main/java/eu/siacs/conversations/ui/SendLogActivity.java index 98cb6df5b..acb43795a 100644 --- a/src/main/java/eu/siacs/conversations/ui/SendLogActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SendLogActivity.java @@ -63,7 +63,6 @@ import java.util.regex.Pattern; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; -import eu.siacs.conversations.services.BarcodeProvider; public class SendLogActivity extends ActionBarActivity { public final static String TAG = "com.xtralogic.android.logcollector"; diff --git a/src/main/java/eu/siacs/conversations/ui/ShareLocationActivity.java b/src/main/java/eu/siacs/conversations/ui/ShareLocationActivity.java index c7ddcc01c..50ba4d8e0 100644 --- a/src/main/java/eu/siacs/conversations/ui/ShareLocationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ShareLocationActivity.java @@ -14,6 +14,11 @@ import androidx.databinding.DataBindingUtil; import com.google.android.material.snackbar.Snackbar; import com.google.common.math.DoubleMath; +import org.osmdroid.api.IGeoPoint; +import org.osmdroid.util.GeoPoint; + +import java.math.RoundingMode; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityShareLocationBinding; @@ -22,11 +27,6 @@ import eu.siacs.conversations.ui.widget.Marker; import eu.siacs.conversations.ui.widget.MyLocation; import eu.siacs.conversations.utils.LocationProvider; -import org.osmdroid.api.IGeoPoint; -import org.osmdroid.util.GeoPoint; - -import java.math.RoundingMode; - public class ShareLocationActivity extends LocationActivity implements LocationListener { private Snackbar snackBar; diff --git a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java index fd7365669..d0ac8c94a 100644 --- a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java @@ -12,7 +12,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.Comparator; @@ -32,9 +31,6 @@ import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.ui.adapter.ConversationAdapter; import eu.siacs.conversations.xmpp.Jid; -import java.util.ArrayList; -import java.util.List; - public class ShareWithActivity extends XmppActivity implements XmppConnectionService.OnConversationUpdate { diff --git a/src/main/java/eu/siacs/conversations/ui/ShowLocationActivity.java b/src/main/java/eu/siacs/conversations/ui/ShowLocationActivity.java index 8ed7e1da6..0d8992eec 100644 --- a/src/main/java/eu/siacs/conversations/ui/ShowLocationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ShowLocationActivity.java @@ -21,6 +21,10 @@ import androidx.databinding.DataBindingUtil; import com.google.common.base.Strings; import com.google.common.primitives.Doubles; +import org.osmdroid.util.GeoPoint; + +import java.util.Map; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityShowLocationBinding; @@ -31,10 +35,6 @@ import eu.siacs.conversations.ui.widget.MyLocation; import eu.siacs.conversations.utils.GeoHelper; import eu.siacs.conversations.utils.LocationProvider; -import org.osmdroid.util.GeoPoint; - -import java.util.Map; - public class ShowLocationActivity extends LocationActivity implements LocationListener { private GeoPoint loc = LocationProvider.FALLBACK; diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 29d9b7a9e..78bb65549 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -9,11 +9,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.content.res.Resources; import android.database.DataSetObserver; -import android.graphics.Color; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -25,7 +21,6 @@ import android.text.method.LinkMovementMethod; import android.util.AttributeSet; import android.util.Log; import android.util.Pair; -import android.util.TypedValue; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.KeyEvent; @@ -34,7 +29,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.view.ViewParent; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; @@ -47,8 +41,6 @@ import android.widget.ExpandableListView; import android.widget.FrameLayout; import android.widget.ListAdapter; import android.widget.ListView; -import android.widget.Space; -import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; @@ -71,7 +63,6 @@ import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; import com.google.android.material.textfield.TextInputLayout; -import com.google.common.collect.Iterables; import com.leinardi.android.speeddial.SpeedDialActionItem; import com.leinardi.android.speeddial.SpeedDialView; @@ -86,7 +77,6 @@ import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Function; import java.util.stream.Collectors; import eu.siacs.conversations.BuildConfig; @@ -112,7 +102,6 @@ import eu.siacs.conversations.ui.util.SoftKeyboardUtils; import eu.siacs.conversations.ui.util.StyledAttributes; import eu.siacs.conversations.ui.widget.SwipeRefreshListFragment; import eu.siacs.conversations.utils.AccountUtils; -import eu.siacs.conversations.utils.StringUtils; import eu.siacs.conversations.utils.UIHelper; import eu.siacs.conversations.utils.XmppUri; import eu.siacs.conversations.xmpp.Jid; diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java index ba069b9a5..7adcbe78a 100644 --- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java @@ -1,6 +1,5 @@ package eu.siacs.conversations.ui; -import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.util.Log; @@ -16,6 +15,15 @@ import androidx.databinding.DataBindingUtil; import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import org.whispersystems.libsignal.IdentityKey; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.OmemoSetting; @@ -33,15 +41,6 @@ import eu.siacs.conversations.utils.XmppUri; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.OnKeyStatusUpdated; -import org.whispersystems.libsignal.IdentityKey; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; - public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdated { private final Map ownKeysToTrust = new HashMap<>(); private final Map> foreignKeysToTrust = new HashMap<>(); diff --git a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java index 199847181..30ae331fe 100644 --- a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java @@ -18,6 +18,11 @@ import androidx.databinding.DataBindingUtil; import com.google.common.base.Strings; +import java.io.IOException; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityUriHandlerBinding; @@ -29,18 +34,12 @@ import eu.siacs.conversations.utils.SignupUtils; import eu.siacs.conversations.utils.ThemeHelper; import eu.siacs.conversations.utils.XmppUri; import eu.siacs.conversations.xmpp.Jid; - import okhttp3.Call; import okhttp3.Callback; import okhttp3.HttpUrl; import okhttp3.Request; import okhttp3.Response; -import java.io.IOException; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - public class UriHandlerActivity extends BaseActivity { public static final String ACTION_SCAN_QR_CODE = "scan_qr_code"; diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 82b2f4e08..8f6a4400d 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -16,7 +16,6 @@ import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; -import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Point; @@ -84,19 +83,12 @@ import eu.siacs.conversations.ui.util.SettingsUtils; import eu.siacs.conversations.ui.util.SoftKeyboardUtils; import eu.siacs.conversations.utils.AccountUtils; import eu.siacs.conversations.utils.Compatibility; -import eu.siacs.conversations.utils.ExceptionHelper; import eu.siacs.conversations.utils.SignupUtils; import eu.siacs.conversations.utils.ThemeHelper; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.OnKeyStatusUpdated; import eu.siacs.conversations.xmpp.OnUpdateBlocklist; -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.RejectedExecutionException; - public abstract class XmppActivity extends ActionBarActivity { public static final String EXTRA_ACCOUNT = "account"; diff --git a/src/main/java/eu/siacs/conversations/ui/activity/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/activity/SettingsActivity.java index 7ac855534..ffc55d34d 100644 --- a/src/main/java/eu/siacs/conversations/ui/activity/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/activity/SettingsActivity.java @@ -8,6 +8,8 @@ import androidx.preference.PreferenceFragmentCompat; import com.google.common.collect.ImmutableSet; +import java.util.Collections; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivitySettingsBinding; import eu.siacs.conversations.ui.Activities; @@ -16,8 +18,6 @@ import eu.siacs.conversations.ui.fragment.settings.MainSettingsFragment; import eu.siacs.conversations.ui.fragment.settings.NotificationsSettingsFragment; import eu.siacs.conversations.ui.fragment.settings.XmppPreferenceFragment; -import java.util.Collections; - public class SettingsActivity extends XmppActivity { @Override diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java index 88475c580..0e7c554e1 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java @@ -10,15 +10,14 @@ import androidx.databinding.DataBindingUtil; import com.google.android.material.color.MaterialColors; -import eu.siacs.conversations.Config; +import java.util.List; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ItemAccountBinding; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.ui.XmppActivity; import eu.siacs.conversations.ui.util.AvatarWorkerTask; -import java.util.List; - public class AccountAdapter extends ArrayAdapter { private final XmppActivity activity; diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java index aa6fd1b78..c816c94fc 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java @@ -13,6 +13,8 @@ import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListAdapter; import androidx.recyclerview.widget.RecyclerView; +import java.util.Locale; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ItemChannelDiscoveryBinding; import eu.siacs.conversations.entities.Room; @@ -20,8 +22,6 @@ import eu.siacs.conversations.ui.XmppActivity; import eu.siacs.conversations.ui.util.AvatarWorkerTask; import eu.siacs.conversations.xmpp.Jid; -import java.util.Locale; - public class ChannelSearchResultAdapter extends ListAdapter implements View.OnCreateContextMenuListener { private static final DiffUtil.ItemCallback DIFF = new DiffUtil.ItemCallback<>() { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index 740db833e..5083568c4 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -2,8 +2,6 @@ package eu.siacs.conversations.ui.adapter; import android.content.Context; import android.content.SharedPreferences; -import android.content.res.TypedArray; -import android.database.DataSetObserver; import android.content.res.ColorStateList; import android.graphics.Typeface; import android.preference.PreferenceManager; @@ -21,9 +19,6 @@ import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.RecyclerView; import com.google.common.base.Optional; -import com.google.common.base.Strings; - -import org.checkerframework.checker.units.qual.C; import java.util.ArrayList; import java.util.Collections; @@ -35,9 +30,8 @@ import java.util.Map; import java.util.Set; import eu.siacs.conversations.R; -import eu.siacs.conversations.databinding.ConversationListRowBinding; -import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.databinding.ItemConversationBinding; +import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Conversational; import eu.siacs.conversations.entities.ListItem; @@ -51,8 +45,6 @@ import eu.siacs.conversations.utils.UIHelper; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.jingle.OngoingRtpSession; -import java.util.List; - public class ConversationAdapter extends RecyclerView.Adapter { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java index b085cb964..1e8df0740 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java @@ -9,14 +9,14 @@ import androidx.annotation.NonNull; import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; -import eu.siacs.conversations.Config; - import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Locale; import java.util.regex.Pattern; +import eu.siacs.conversations.Config; + public class KnownHostsAdapter extends ArrayAdapter { private static final Pattern E164_PATTERN = Pattern.compile("^\\+[1-9]\\d{1,14}$"); diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java index 4f9311392..d9d9451af 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java @@ -22,6 +22,8 @@ import com.google.android.material.color.MaterialColors; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; +import java.util.List; + import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; @@ -36,8 +38,6 @@ import eu.siacs.conversations.utils.UIHelper; import eu.siacs.conversations.utils.XEP0392Helper; import eu.siacs.conversations.xmpp.Jid; -import java.util.List; - public class ListItemAdapter extends ArrayAdapter { protected XmppActivity activity; diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java index 7b3a35ab3..99378457a 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java @@ -21,6 +21,12 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.color.MaterialColors; import com.google.common.base.Strings; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.RejectedExecutionException; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ItemMediaBinding; import eu.siacs.conversations.ui.XmppActivity; @@ -28,12 +34,6 @@ import eu.siacs.conversations.ui.util.Attachment; import eu.siacs.conversations.ui.util.ViewUtil; import eu.siacs.conversations.worker.ExportBackupWorker; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.RejectedExecutionException; - public class MediaAdapter extends RecyclerView.Adapter { public static final List DOCUMENT_MIMES = diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MediaPreviewAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MediaPreviewAdapter.java index 3aecd30fa..6864a5f38 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MediaPreviewAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MediaPreviewAdapter.java @@ -9,9 +9,7 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; -import android.util.Log; import android.view.LayoutInflater; -import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.Toast; @@ -22,11 +20,11 @@ import androidx.core.widget.ImageViewCompat; import androidx.databinding.DataBindingUtil; import androidx.recyclerview.widget.RecyclerView; -import eu.siacs.conversations.Config; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.concurrent.RejectedExecutionException; + import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ItemMediaPreviewBinding; import eu.siacs.conversations.persistance.FileBackend; @@ -35,12 +33,6 @@ import eu.siacs.conversations.ui.ShowLocationActivity; import eu.siacs.conversations.ui.XmppActivity; import eu.siacs.conversations.ui.util.Attachment; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.concurrent.RejectedExecutionException; - public class MediaPreviewAdapter extends RecyclerView.Adapter { diff --git a/src/main/java/eu/siacs/conversations/ui/fragment/settings/BackupSettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/fragment/settings/BackupSettingsFragment.java index f78577656..69eeece69 100644 --- a/src/main/java/eu/siacs/conversations/ui/fragment/settings/BackupSettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/fragment/settings/BackupSettingsFragment.java @@ -27,13 +27,13 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.base.Strings; import com.google.common.primitives.Longs; +import java.util.concurrent.TimeUnit; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.persistance.FileBackend; import eu.siacs.conversations.worker.ExportBackupWorker; -import java.util.concurrent.TimeUnit; - public class BackupSettingsFragment extends XmppPreferenceFragment { public static final String CREATE_ONE_OFF_BACKUP = "create_one_off_backup"; diff --git a/src/main/java/eu/siacs/conversations/ui/fragment/settings/SecuritySettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/fragment/settings/SecuritySettingsFragment.java index 0ccf2679e..4252c7cfa 100644 --- a/src/main/java/eu/siacs/conversations/ui/fragment/settings/SecuritySettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/fragment/settings/SecuritySettingsFragment.java @@ -13,15 +13,15 @@ import androidx.preference.Preference; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.base.Strings; +import java.security.KeyStoreException; +import java.util.ArrayList; +import java.util.Collections; + import eu.siacs.conversations.AppSettings; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.OmemoSetting; import eu.siacs.conversations.services.MemorizingTrustManager; -import java.security.KeyStoreException; -import java.util.ArrayList; -import java.util.Collections; - public class SecuritySettingsFragment extends XmppPreferenceFragment { private static final String REMOVE_TRUSTED_CERTIFICATES = "remove_trusted_certificates"; diff --git a/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java index 771acbbe1..cf9448f78 100644 --- a/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java @@ -12,15 +12,15 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; -import eu.siacs.conversations.R; -import eu.siacs.conversations.receiver.UnifiedPushDistributor; -import eu.siacs.conversations.xmpp.Jid; - import java.net.URI; import java.net.URISyntaxException; import java.util.Arrays; import java.util.List; +import eu.siacs.conversations.R; +import eu.siacs.conversations.receiver.UnifiedPushDistributor; +import eu.siacs.conversations.xmpp.Jid; + public class UpSettingsFragment extends XmppPreferenceFragment { @Override diff --git a/src/main/java/eu/siacs/conversations/ui/service/AudioPlayer.java b/src/main/java/eu/siacs/conversations/ui/service/AudioPlayer.java index cb8b591d7..27e979a4f 100644 --- a/src/main/java/eu/siacs/conversations/ui/service/AudioPlayer.java +++ b/src/main/java/eu/siacs/conversations/ui/service/AudioPlayer.java @@ -24,6 +24,10 @@ import androidx.core.content.ContextCompat; import com.google.common.primitives.Ints; +import java.lang.ref.WeakReference; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Message; @@ -34,10 +38,6 @@ import eu.siacs.conversations.ui.util.PendingItem; import eu.siacs.conversations.utils.TimeFrameUtils; import eu.siacs.conversations.utils.WeakReferenceSet; -import java.lang.ref.WeakReference; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompletionListener, diff --git a/src/main/java/eu/siacs/conversations/ui/text/FixedURLSpan.java b/src/main/java/eu/siacs/conversations/ui/text/FixedURLSpan.java index fa7a4f898..bb4571997 100644 --- a/src/main/java/eu/siacs/conversations/ui/text/FixedURLSpan.java +++ b/src/main/java/eu/siacs/conversations/ui/text/FixedURLSpan.java @@ -34,7 +34,6 @@ import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.os.Build; import android.text.Editable; import android.text.Spanned; import android.text.style.URLSpan; diff --git a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java index aee735d88..492ff7a5b 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/Attachment.java +++ b/src/main/java/eu/siacs/conversations/ui/util/Attachment.java @@ -40,15 +40,15 @@ import androidx.annotation.NonNull; import com.google.common.base.MoreObjects; -import eu.siacs.conversations.entities.Message; -import eu.siacs.conversations.utils.MimeUtils; - import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; +import eu.siacs.conversations.entities.Message; +import eu.siacs.conversations.utils.MimeUtils; + public class Attachment implements Parcelable { Attachment(Parcel in) { diff --git a/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java b/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java index 16977fbb9..0420e5517 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java +++ b/src/main/java/eu/siacs/conversations/ui/util/MucDetailsContextMenuHelper.java @@ -10,8 +10,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; -import androidx.appcompat.app.AlertDialog; - import com.google.android.material.dialog.MaterialAlertDialogBuilder; import eu.siacs.conversations.Config; diff --git a/src/main/java/eu/siacs/conversations/ui/util/MyLinkify.java b/src/main/java/eu/siacs/conversations/ui/util/MyLinkify.java index d5d3a82da..dfff1c0de 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/MyLinkify.java +++ b/src/main/java/eu/siacs/conversations/ui/util/MyLinkify.java @@ -42,7 +42,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Locale; -import java.util.Objects; import eu.siacs.conversations.ui.text.FixedURLSpan; import eu.siacs.conversations.utils.GeoHelper; diff --git a/src/main/java/eu/siacs/conversations/ui/util/PresenceSelector.java b/src/main/java/eu/siacs/conversations/ui/util/PresenceSelector.java index a26d02810..402d1077c 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/PresenceSelector.java +++ b/src/main/java/eu/siacs/conversations/ui/util/PresenceSelector.java @@ -34,8 +34,6 @@ import android.content.Context; import android.util.Pair; import android.widget.Toast; -import androidx.appcompat.app.AlertDialog; - import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.Collections; diff --git a/src/main/java/eu/siacs/conversations/ui/util/ViewUtil.java b/src/main/java/eu/siacs/conversations/ui/util/ViewUtil.java index 1cc630ad3..a027816d5 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/ViewUtil.java +++ b/src/main/java/eu/siacs/conversations/ui/util/ViewUtil.java @@ -3,14 +3,11 @@ package eu.siacs.conversations.ui.util; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; import android.net.Uri; import android.util.Log; import android.widget.Toast; import java.io.File; -import java.util.List; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; diff --git a/src/main/java/eu/siacs/conversations/utils/AccountUtils.java b/src/main/java/eu/siacs/conversations/utils/AccountUtils.java index fe70241f9..5011c07f8 100644 --- a/src/main/java/eu/siacs/conversations/utils/AccountUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/AccountUtils.java @@ -14,7 +14,6 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.services.XmppConnectionService; diff --git a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java index 0b03dc640..a4526057e 100644 --- a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java @@ -8,15 +8,6 @@ import android.util.Log; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import eu.siacs.conversations.AppSettings; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.entities.Conversation; -import eu.siacs.conversations.entities.Message; -import eu.siacs.conversations.services.XmppConnectionService; -import eu.siacs.conversations.ui.XmppActivity; - import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; @@ -26,6 +17,15 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +import eu.siacs.conversations.AppSettings; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Conversation; +import eu.siacs.conversations.entities.Message; +import eu.siacs.conversations.services.XmppConnectionService; +import eu.siacs.conversations.ui.XmppActivity; + public class ExceptionHelper { private static final String FILENAME = "stacktrace.txt"; diff --git a/src/main/java/eu/siacs/conversations/utils/FileUtils.java b/src/main/java/eu/siacs/conversations/utils/FileUtils.java index e439ab030..d9553f04f 100644 --- a/src/main/java/eu/siacs/conversations/utils/FileUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/FileUtils.java @@ -5,7 +5,6 @@ import android.content.ContentUris; import android.content.Context; import android.database.Cursor; import android.net.Uri; -import android.os.Build; import android.os.Environment; import android.provider.DocumentsContract; import android.provider.MediaStore; diff --git a/src/main/java/eu/siacs/conversations/utils/IrregularUnicodeDetector.java b/src/main/java/eu/siacs/conversations/utils/IrregularUnicodeDetector.java index 5cc093249..64eb5b630 100644 --- a/src/main/java/eu/siacs/conversations/utils/IrregularUnicodeDetector.java +++ b/src/main/java/eu/siacs/conversations/utils/IrregularUnicodeDetector.java @@ -54,7 +54,6 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import eu.siacs.conversations.R; import eu.siacs.conversations.xmpp.Jid; public class IrregularUnicodeDetector { diff --git a/src/main/java/eu/siacs/conversations/utils/SSLSockets.java b/src/main/java/eu/siacs/conversations/utils/SSLSockets.java index 4a8680e20..8733f6222 100644 --- a/src/main/java/eu/siacs/conversations/utils/SSLSockets.java +++ b/src/main/java/eu/siacs/conversations/utils/SSLSockets.java @@ -7,9 +7,6 @@ import androidx.annotation.RequiresApi; import com.google.common.base.Strings; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.entities.Account; - import org.conscrypt.Conscrypt; import java.lang.reflect.Method; @@ -27,6 +24,9 @@ import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.entities.Account; + public class SSLSockets { public static void setSecurity(final SSLSocket sslSocket) { diff --git a/src/main/java/eu/siacs/conversations/utils/StylingHelper.java b/src/main/java/eu/siacs/conversations/utils/StylingHelper.java index fc669c87d..bdefff13e 100644 --- a/src/main/java/eu/siacs/conversations/utils/StylingHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/StylingHelper.java @@ -29,7 +29,6 @@ package eu.siacs.conversations.utils; -import android.content.Context; import android.graphics.Color; import android.graphics.Typeface; import android.text.Editable; @@ -47,7 +46,6 @@ import android.widget.EditText; import android.widget.TextView; import androidx.annotation.ColorInt; -import androidx.core.content.ContextCompat; import com.google.android.material.color.MaterialColors; @@ -55,7 +53,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.ui.text.QuoteSpan; diff --git a/src/main/java/eu/siacs/conversations/utils/ThemeHelper.java b/src/main/java/eu/siacs/conversations/utils/ThemeHelper.java index 8a141a507..6747842e2 100644 --- a/src/main/java/eu/siacs/conversations/utils/ThemeHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/ThemeHelper.java @@ -34,7 +34,6 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; -import android.graphics.Color; import android.os.Build; import android.preference.PreferenceManager; import android.util.TypedValue; diff --git a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java index 54880be8f..0bdf13bf3 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java @@ -4,12 +4,12 @@ import com.google.common.base.Joiner; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import eu.siacs.conversations.xml.Element; - import java.util.Collection; import java.util.Collections; import java.util.List; +import eu.siacs.conversations.xml.Element; + public class XmlHelper { public static String encodeEntities(String content) { content = content.replace("&", "&"); diff --git a/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java b/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java index 75ef9036c..ec512e590 100644 --- a/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java +++ b/src/main/java/eu/siacs/conversations/worker/ExportBackupWorker.java @@ -25,18 +25,6 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.gson.stream.JsonWriter; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.R; -import eu.siacs.conversations.crypto.axolotl.SQLiteAxolotlStore; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.entities.Conversation; -import eu.siacs.conversations.entities.Message; -import eu.siacs.conversations.persistance.DatabaseBackend; -import eu.siacs.conversations.persistance.FileBackend; -import eu.siacs.conversations.receiver.WorkManagerEventReceiver; -import eu.siacs.conversations.utils.BackupFileHeader; -import eu.siacs.conversations.utils.Compatibility; - import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -65,6 +53,18 @@ import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.SecretKeySpec; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.crypto.axolotl.SQLiteAxolotlStore; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.entities.Conversation; +import eu.siacs.conversations.entities.Message; +import eu.siacs.conversations.persistance.DatabaseBackend; +import eu.siacs.conversations.persistance.FileBackend; +import eu.siacs.conversations.receiver.WorkManagerEventReceiver; +import eu.siacs.conversations.utils.BackupFileHeader; +import eu.siacs.conversations.utils.Compatibility; + public class ExportBackupWorker extends Worker { private static final SimpleDateFormat DATE_FORMAT = diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 75bd661b3..b652adaa5 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -114,50 +114,8 @@ import eu.siacs.conversations.xmpp.stanzas.streammgmt.AckPacket; import eu.siacs.conversations.xmpp.stanzas.streammgmt.EnablePacket; import eu.siacs.conversations.xmpp.stanzas.streammgmt.RequestPacket; import eu.siacs.conversations.xmpp.stanzas.streammgmt.ResumePacket; - import okhttp3.HttpUrl; -import org.xmlpull.v1.XmlPullParserException; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.ConnectException; -import java.net.IDN; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.UnknownHostException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.Principal; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.regex.Matcher; - -import javax.net.ssl.KeyManager; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.X509KeyManager; -import javax.net.ssl.X509TrustManager; - public class XmppConnection implements Runnable { private static final int PACKET_IQ = 0; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractContentMap.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractContentMap.java index 847678a05..a0e15c6a6 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractContentMap.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractContentMap.java @@ -4,16 +4,16 @@ import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import eu.siacs.conversations.xmpp.jingle.stanzas.Content; import eu.siacs.conversations.xmpp.jingle.stanzas.GenericDescription; import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.Group; import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; -import java.util.List; -import java.util.Map; -import java.util.Set; - public abstract class AbstractContentMap< D extends GenericDescription, T extends GenericTransportInfo> { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java index 6aeb348c1..32574594e 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/AbstractJingleConnection.java @@ -11,6 +11,12 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + import eu.siacs.conversations.Config; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; @@ -23,12 +29,6 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; import eu.siacs.conversations.xmpp.jingle.stanzas.Reason; import eu.siacs.conversations.xmpp.stanzas.IqPacket; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; - public abstract class AbstractJingleConnection { public static final String JINGLE_MESSAGE_PROPOSE_ID_PREFIX = "jm-propose-"; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java index a2a5c4032..53c79a9f0 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/DirectConnectionUtils.java @@ -7,13 +7,8 @@ import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.net.UnknownHostException; -import java.security.SecureRandom; -import java.util.ArrayList; import java.util.Enumeration; import java.util.List; -import java.util.UUID; - -import eu.siacs.conversations.xmpp.Jid; public class DirectConnectionUtils { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/FileTransferContentMap.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/FileTransferContentMap.java index c678c91cb..3e73359ac 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/FileTransferContentMap.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/FileTransferContentMap.java @@ -4,6 +4,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.jingle.stanzas.Content; @@ -14,16 +19,10 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.Group; import eu.siacs.conversations.xmpp.jingle.stanzas.IbbTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; -import eu.siacs.conversations.xmpp.jingle.stanzas.RtpDescription; import eu.siacs.conversations.xmpp.jingle.stanzas.SocksByteStreamsTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; import eu.siacs.conversations.xmpp.jingle.transports.Transport; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - public class FileTransferContentMap extends AbstractContentMap { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/IceServers.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/IceServers.java index 7b2f88457..d2e192ddd 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/IceServers.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/IceServers.java @@ -6,18 +6,18 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.utils.IP; -import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - import org.webrtc.PeerConnection; import java.util.Arrays; import java.util.Collections; import java.util.List; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.utils.IP; +import eu.siacs.conversations.xml.Element; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; + public final class IceServers { public static List parse(final IqPacket response) { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java index 6d0ec1e82..20fb34b3c 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -15,6 +15,19 @@ import com.google.common.collect.Collections2; import com.google.common.collect.ComparisonChain; import com.google.common.collect.ImmutableSet; +import java.lang.ref.WeakReference; +import java.security.SecureRandom; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + import eu.siacs.conversations.Config; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; @@ -42,19 +55,6 @@ import eu.siacs.conversations.xmpp.jingle.transports.Transport; import eu.siacs.conversations.xmpp.stanzas.IqPacket; import eu.siacs.conversations.xmpp.stanzas.MessagePacket; -import java.lang.ref.WeakReference; -import java.security.SecureRandom; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - public class JingleConnectionManager extends AbstractConnectionManager { public static final ScheduledExecutorService SCHEDULED_EXECUTOR_SERVICE = Executors.newSingleThreadScheduledExecutor(); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java index 60365e6ea..21ed3c064 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleFileTransferConnection.java @@ -17,30 +17,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; -import eu.siacs.conversations.entities.Conversation; -import eu.siacs.conversations.entities.Message; -import eu.siacs.conversations.entities.Transferable; -import eu.siacs.conversations.entities.TransferablePlaceholder; -import eu.siacs.conversations.services.AbstractConnectionManager; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.XmppConnection; -import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription; -import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.IbbTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; -import eu.siacs.conversations.xmpp.jingle.stanzas.Reason; -import eu.siacs.conversations.xmpp.jingle.stanzas.SocksByteStreamsTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; -import eu.siacs.conversations.xmpp.jingle.transports.InbandBytestreamsTransport; -import eu.siacs.conversations.xmpp.jingle.transports.SocksByteStreamsTransport; -import eu.siacs.conversations.xmpp.jingle.transports.Transport; -import eu.siacs.conversations.xmpp.jingle.transports.WebRTCDataChannelTransport; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.io.CipherInputStream; import org.bouncycastle.crypto.io.CipherOutputStream; @@ -68,6 +44,30 @@ import java.util.Optional; import java.util.Queue; import java.util.concurrent.CountDownLatch; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; +import eu.siacs.conversations.entities.Conversation; +import eu.siacs.conversations.entities.Message; +import eu.siacs.conversations.entities.Transferable; +import eu.siacs.conversations.entities.TransferablePlaceholder; +import eu.siacs.conversations.services.AbstractConnectionManager; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription; +import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.IbbTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; +import eu.siacs.conversations.xmpp.jingle.stanzas.Reason; +import eu.siacs.conversations.xmpp.jingle.stanzas.SocksByteStreamsTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; +import eu.siacs.conversations.xmpp.jingle.transports.InbandBytestreamsTransport; +import eu.siacs.conversations.xmpp.jingle.transports.SocksByteStreamsTransport; +import eu.siacs.conversations.xmpp.jingle.transports.Transport; +import eu.siacs.conversations.xmpp.jingle.transports.WebRTCDataChannelTransport; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; + public class JingleFileTransferConnection extends AbstractJingleConnection implements Transport.Callback, Transferable { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index ba78ab909..9e46430f3 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -25,6 +25,23 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import org.webrtc.EglBase; +import org.webrtc.IceCandidate; +import org.webrtc.PeerConnection; +import org.webrtc.VideoTrack; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + import eu.siacs.conversations.BuildConfig; import eu.siacs.conversations.Config; import eu.siacs.conversations.crypto.axolotl.AxolotlService; @@ -51,23 +68,6 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.RtpDescription; import eu.siacs.conversations.xmpp.stanzas.IqPacket; import eu.siacs.conversations.xmpp.stanzas.MessagePacket; -import org.webrtc.EglBase; -import org.webrtc.IceCandidate; -import org.webrtc.PeerConnection; -import org.webrtc.VideoTrack; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Queue; -import java.util.Set; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - public class JingleRtpConnection extends AbstractJingleConnection implements WebRTCWrapper.EventCallback, CallIntegration.Callback, OngoingRtpSession { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/OngoingRtpSession.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/OngoingRtpSession.java index 358411bcb..2957492a1 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/OngoingRtpSession.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/OngoingRtpSession.java @@ -1,11 +1,11 @@ package eu.siacs.conversations.xmpp.jingle; +import java.util.Set; + import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.services.CallIntegration; import eu.siacs.conversations.xmpp.Jid; -import java.util.Set; - public interface OngoingRtpSession { Account getAccount(); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpCapability.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpCapability.java index b53f0b9e8..406d064df 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpCapability.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpCapability.java @@ -5,7 +5,6 @@ import com.google.common.collect.Collections2; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java index 94f8ca300..b2d58ab3f 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java @@ -13,6 +13,14 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nonnull; + import eu.siacs.conversations.xmpp.jingle.stanzas.Content; import eu.siacs.conversations.xmpp.jingle.stanzas.GenericDescription; import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; @@ -22,14 +30,6 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.JinglePacket; import eu.siacs.conversations.xmpp.jingle.stanzas.OmemoVerifiedIceUdpTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.RtpDescription; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.Nonnull; - public class RtpContentMap extends AbstractContentMap { public RtpContentMap( diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java index 025a7acc9..aa82bcb95 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java @@ -13,6 +13,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Map; + import eu.siacs.conversations.Config; import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.jingle.stanzas.FileTransferDescription; @@ -22,12 +28,6 @@ import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; import eu.siacs.conversations.xmpp.jingle.stanzas.RtpDescription; import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Map; - public class SessionDescription { public static final String LINE_DIVIDER = "\r\n"; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java index 4b4b23d82..bb0ee5c68 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/ToneManager.java @@ -1,11 +1,15 @@ package eu.siacs.conversations.xmpp.jingle; +import static java.util.Arrays.asList; + import android.content.Context; import android.media.AudioManager; import android.media.ToneGenerator; import android.os.Build; import android.util.Log; +import androidx.core.content.ContextCompat; + import java.util.Arrays; import java.util.Set; import java.util.concurrent.ScheduledFuture; @@ -13,10 +17,6 @@ import java.util.concurrent.TimeUnit; import eu.siacs.conversations.Config; -import static java.util.Arrays.asList; - -import androidx.core.content.ContextCompat; - class ToneManager { private ToneGenerator toneGenerator; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java index 16e89ca3b..173e46b89 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/TrackWrapper.java @@ -6,8 +6,6 @@ import com.google.common.base.CaseFormat; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import eu.siacs.conversations.Config; - import org.webrtc.MediaStreamTrack; import org.webrtc.PeerConnection; import org.webrtc.RtpSender; @@ -18,6 +16,8 @@ import java.util.UUID; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import eu.siacs.conversations.Config; + class TrackWrapper { public final T track; public final RtpSender rtpSender; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index bda9878aa..0bb34b75f 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -14,16 +14,12 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.services.XmppConnectionService; - import org.webrtc.AudioSource; import org.webrtc.AudioTrack; import org.webrtc.CandidatePairChangeEvent; import org.webrtc.DataChannel; import org.webrtc.DefaultVideoDecoderFactory; import org.webrtc.DefaultVideoEncoderFactory; -import org.webrtc.DtmfSender; import org.webrtc.EglBase; import org.webrtc.IceCandidate; import org.webrtc.MediaConstraints; @@ -40,8 +36,8 @@ import org.webrtc.audio.JavaAudioDeviceModule; import java.util.LinkedList; import java.util.List; -import java.util.Queue; import java.util.Map; +import java.util.Queue; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -52,6 +48,9 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.services.XmppConnectionService; + public class WebRTCWrapper { private static final String EXTENDED_LOGGING_TAG = WebRTCWrapper.class.getSimpleName(); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java index a4cb13e07..26ab2feb2 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Content.java @@ -8,6 +8,9 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.ImmutableSet; +import java.util.Locale; +import java.util.Set; + import eu.siacs.conversations.Config; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; @@ -16,9 +19,6 @@ import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.jingle.SessionDescription; -import java.util.Locale; -import java.util.Set; - public class Content extends Element { public Content(final Creator creator, final Senders senders, final String name) { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/FileTransferDescription.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/FileTransferDescription.java index 3878d98d9..02a0c1cde 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/FileTransferDescription.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/FileTransferDescription.java @@ -12,12 +12,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.io.BaseEncoding; import com.google.common.primitives.Longs; +import java.util.List; + import eu.siacs.conversations.Config; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; -import java.util.List; - public class FileTransferDescription extends GenericDescription { private FileTransferDescription() { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/IceUdpTransportInfo.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/IceUdpTransportInfo.java index 8d90b1982..f3609ea98 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/IceUdpTransportInfo.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/IceUdpTransportInfo.java @@ -10,19 +10,12 @@ import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.base.Strings; -import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Multimap; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.jingle.SessionDescription; -import eu.siacs.conversations.xmpp.jingle.transports.Transport; - import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -34,6 +27,12 @@ import java.util.Locale; import java.util.Map; import java.util.UUID; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.xml.Element; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.jingle.SessionDescription; +import eu.siacs.conversations.xmpp.jingle.transports.Transport; + public class IceUdpTransportInfo extends GenericTransportInfo { public static final IceUdpTransportInfo STUB = new IceUdpTransportInfo(); diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java index a24040d3d..788dbb013 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/JinglePacket.java @@ -7,13 +7,13 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; +import java.util.Map; + import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.Jid; import eu.siacs.conversations.xmpp.stanzas.IqPacket; -import java.util.Map; - public class JinglePacket extends IqPacket { private JinglePacket() { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java index 669a01c49..f734e0685 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/Reason.java @@ -5,7 +5,6 @@ import androidx.annotation.NonNull; import com.google.common.base.CaseFormat; import com.google.common.base.Throwables; -import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.CryptoFailedException; import eu.siacs.conversations.xmpp.jingle.RtpContentMap; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/SocksByteStreamsTransportInfo.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/SocksByteStreamsTransportInfo.java index 4b1d85847..1386a9ff0 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/SocksByteStreamsTransportInfo.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/stanzas/SocksByteStreamsTransportInfo.java @@ -6,14 +6,14 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; +import java.util.Collection; +import java.util.List; + import eu.siacs.conversations.Config; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xml.Namespace; import eu.siacs.conversations.xmpp.jingle.transports.SocksByteStreamsTransport; -import java.util.Collection; -import java.util.List; - public class SocksByteStreamsTransportInfo extends GenericTransportInfo { private SocksByteStreamsTransportInfo() { diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/InbandBytestreamsTransport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/InbandBytestreamsTransport.java index ce2d4b31f..e868ea02f 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/InbandBytestreamsTransport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/InbandBytestreamsTransport.java @@ -9,15 +9,6 @@ import com.google.common.primitives.Ints; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.XmppConnection; -import eu.siacs.conversations.xmpp.jingle.stanzas.IbbTransportInfo; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - import java.io.Closeable; import java.io.IOException; import java.io.InputStream; @@ -31,6 +22,15 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.xml.Element; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.jingle.stanzas.IbbTransportInfo; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; + public class InbandBytestreamsTransport implements Transport { private static final int DEFAULT_BLOCK_SIZE = 8192; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/SocksByteStreamsTransport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/SocksByteStreamsTransport.java index bbda1c622..a5d0c9934 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/SocksByteStreamsTransport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/SocksByteStreamsTransport.java @@ -23,17 +23,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.utils.SocksSocketFactory; -import eu.siacs.conversations.xml.Element; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.Jid; -import eu.siacs.conversations.xmpp.XmppConnection; -import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection; -import eu.siacs.conversations.xmpp.jingle.DirectConnectionUtils; -import eu.siacs.conversations.xmpp.jingle.stanzas.SocksByteStreamsTransportInfo; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -60,6 +49,17 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.utils.SocksSocketFactory; +import eu.siacs.conversations.xml.Element; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.Jid; +import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.jingle.AbstractJingleConnection; +import eu.siacs.conversations.xmpp.jingle.DirectConnectionUtils; +import eu.siacs.conversations.xmpp.jingle.stanzas.SocksByteStreamsTransportInfo; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; + public class SocksByteStreamsTransport implements Transport { private final XmppConnection xmppConnection; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/Transport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/Transport.java index ce99ac8cc..d24ca9637 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/Transport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/Transport.java @@ -2,14 +2,14 @@ package eu.siacs.conversations.xmpp.jingle.transports; import com.google.common.util.concurrent.ListenableFuture; -import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.Group; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.concurrent.CountDownLatch; +import eu.siacs.conversations.xmpp.jingle.stanzas.GenericTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.Group; + public interface Transport { OutputStream getOutputStream() throws IOException; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/WebRTCDataChannelTransport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/WebRTCDataChannelTransport.java index e4dd730d5..416a11111 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/WebRTCDataChannelTransport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/transports/WebRTCDataChannelTransport.java @@ -14,16 +14,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; -import eu.siacs.conversations.Config; -import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.xml.Namespace; -import eu.siacs.conversations.xmpp.XmppConnection; -import eu.siacs.conversations.xmpp.jingle.IceServers; -import eu.siacs.conversations.xmpp.jingle.WebRTCWrapper; -import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; -import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; -import eu.siacs.conversations.xmpp.stanzas.IqPacket; - import org.webrtc.CandidatePairChangeEvent; import org.webrtc.DataChannel; import org.webrtc.IceCandidate; @@ -53,6 +43,16 @@ import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Nonnull; +import eu.siacs.conversations.Config; +import eu.siacs.conversations.entities.Account; +import eu.siacs.conversations.xml.Namespace; +import eu.siacs.conversations.xmpp.XmppConnection; +import eu.siacs.conversations.xmpp.jingle.IceServers; +import eu.siacs.conversations.xmpp.jingle.WebRTCWrapper; +import eu.siacs.conversations.xmpp.jingle.stanzas.IceUdpTransportInfo; +import eu.siacs.conversations.xmpp.jingle.stanzas.WebRTCDataChannelTransportInfo; +import eu.siacs.conversations.xmpp.stanzas.IqPacket; + public class WebRTCDataChannelTransport implements Transport { private static final int BUFFER_SIZE = 16_384;