From e8736d5f1ba73a83ce110791ecea27c364544575 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 22 Aug 2022 11:29:04 +0200 Subject: [PATCH] bump guava library --- build.gradle | 4 ++-- .../conversations/http/HttpUploadConnection.java | 14 +++++++------- .../siacs/conversations/ui/RtpSessionActivity.java | 4 ++-- .../conversations/xmpp/jingle/RtpContentMap.java | 11 +---------- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 06c5f0030..c102d9e39 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:7.2.2' } } @@ -73,7 +73,7 @@ dependencies { implementation "com.squareup.retrofit2:converter-gson:2.9.0" implementation "com.squareup.okhttp3:okhttp:4.10.0" - implementation 'com.google.guava:guava:30.1.1-android' + implementation 'com.google.guava:guava:31.1-android' quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.12.49' freeImplementation 'ch.threema:webrtc-android:100.0.0' playstoreImplementation fileTree(include: ['libwebrtc-m104.aar'], dir: 'libs') diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java index 20db7bfbd..3e478dd0f 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java @@ -2,14 +2,14 @@ package eu.siacs.conversations.http; import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; -import org.checkerframework.checker.nullness.compatqual.NullableDecl; -import org.jetbrains.annotations.NotNull; - import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -132,7 +132,7 @@ public class HttpUploadConnection implements Transferable, AbstractConnectionMan this.slotFuture = new SlotRequester(mXmppConnectionService).request(method, account, file, mime); Futures.addCallback(this.slotFuture, new FutureCallback() { @Override - public void onSuccess(@NullableDecl SlotRequester.Slot result) { + public void onSuccess(@Nullable SlotRequester.Slot result) { HttpUploadConnection.this.slot = result; try { HttpUploadConnection.this.upload(); @@ -142,7 +142,7 @@ public class HttpUploadConnection implements Transferable, AbstractConnectionMan } @Override - public void onFailure(@NotNull final Throwable throwable) { + public void onFailure(@NonNull final Throwable throwable) { Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to request slot", throwable); // TODO consider fall back to jingle in 1-on-1 chats with exactly one online presence fail(throwable.getMessage()); @@ -169,13 +169,13 @@ public class HttpUploadConnection implements Transferable, AbstractConnectionMan this.mostRecentCall = client.newCall(request); this.mostRecentCall.enqueue(new Callback() { @Override - public void onFailure(@NotNull Call call, IOException e) { + public void onFailure(@NonNull Call call, IOException e) { Log.d(Config.LOGTAG, "http upload failed", e); fail(e.getMessage()); } @Override - public void onResponse(@NotNull Call call, @NotNull Response response) { + public void onResponse(@NonNull Call call, @NonNull Response response) { final int code = response.code(); if (code == 200 || code == 201) { Log.d(Config.LOGTAG, "finished uploading file"); diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index fc7b50449..cbf00d04b 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -25,6 +25,7 @@ import android.view.WindowManager; import android.widget.Toast; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.StringRes; import androidx.databinding.DataBindingUtil; @@ -37,7 +38,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; -import org.checkerframework.checker.nullness.compatqual.NullableDecl; import org.webrtc.RendererCommon; import org.webrtc.SurfaceViewRenderer; import org.webrtc.VideoTrack; @@ -999,7 +999,7 @@ public class RtpSessionActivity extends XmppActivity requireRtpConnection().switchCamera(), new FutureCallback() { @Override - public void onSuccess(@NullableDecl Boolean isFrontCamera) { + public void onSuccess(@Nullable Boolean isFrontCamera) { binding.localVideo.setMirror(isFrontCamera); } 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 e7693d6a8..bba44f963 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/RtpContentMap.java @@ -1,6 +1,5 @@ package eu.siacs.conversations.xmpp.jingle; -import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.Collections2; @@ -11,8 +10,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import org.checkerframework.checker.nullness.compatqual.NullableDecl; - import java.util.Collection; import java.util.List; import java.util.Map; @@ -292,13 +289,7 @@ public class RtpContentMap { return ImmutableMap.copyOf( Maps.transformValues( contents, - new Function() { - @NullableDecl - @Override - public DescriptionTransport apply(@NullableDecl Content content) { - return content == null ? null : of(content); - } - })); + content -> content == null ? null : of(content))); } }