From 91cc8f50118d41fbf8432bdf9d27ac0bb70736a7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 18 Jan 2021 21:49:31 +0100 Subject: [PATCH] bump various libraries that have been waiting for androidx --- build.gradle | 27 +++++++++---------- .../ui/StartConversationActivity.java | 1 + .../services/PushManagementService.java | 18 ++++++------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index d29c97eb7..bfddf53cd 100644 --- a/build.gradle +++ b/build.gradle @@ -34,27 +34,24 @@ dependencies { implementation 'androidx.viewpager:viewpager:1.0.0' //should remain that low because later versions introduce dependency to androidx (not sure exactly from what version) - playstoreImplementation('com.google.firebase:firebase-messaging:17.3.4') { + playstoreImplementation('com.google.firebase:firebase-messaging:21.0.1') { exclude group: 'com.google.firebase', module: 'firebase-core' exclude group: 'com.google.firebase', module: 'firebase-analytics' exclude group: 'com.google.firebase', module: 'firebase-measurement-connector' } - conversationsPlaystoreCompatImplementation("com.android.installreferrer:installreferrer:1.1.2") - conversationsPlaystoreSystemImplementation("com.android.installreferrer:installreferrer:1.1.2") + conversationsPlaystoreCompatImplementation("com.android.installreferrer:installreferrer:2.2") + conversationsPlaystoreSystemImplementation("com.android.installreferrer:installreferrer:2.2") implementation 'org.sufficientlysecure:openpgp-api:10.0' - implementation('com.theartofdev.edmodo:android-image-cropper:2.7.+') { - exclude group: 'com.android.support', module: 'appcompat-v7' - exclude group: 'com.android.support', module: 'exifinterface' - } - //implementation 'androidx.legacy:legacy-support-v13:1.0.0' - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'androidx.exifinterface:exifinterface:1.0.0' + implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.exifinterface:exifinterface:1.3.2' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'androidx.emoji:emoji:1.0.0' - implementation 'com.google.android.material:material:1.0.0' - compatImplementation 'androidx.emoji:emoji-appcompat:1.0.0' - conversationsFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.0.0' - quicksyFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.0.0' + implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' + implementation 'androidx.emoji:emoji:1.1.0' + implementation 'com.google.android.material:material:1.2.1' + compatImplementation 'androidx.emoji:emoji-appcompat:1.1.0' + conversationsFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0' + quicksyFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0' implementation 'org.bouncycastle:bcmail-jdk15on:1.64' //zxing stopped supporting Java 7 so we have to stick with 3.3.3 //https://github.com/zxing/zxing/issues/1170 diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index e77efc127..ac86aedef 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -376,6 +376,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne @Override public void onNewIntent(final Intent intent) { + super.onNewIntent(intent); if (xmppConnectionServiceBound) { processViewIntent(intent); } else { diff --git a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java index ae883f524..987b511e5 100644 --- a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java +++ b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java @@ -4,8 +4,7 @@ import android.util.Log; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.InstanceIdResult; +import com.google.firebase.messaging.FirebaseMessaging; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; @@ -55,7 +54,7 @@ public class PushManagementService { e.printStackTrace(); } } else { - Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": failed to enable push. invalid response from app server "+response); + Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": failed to enable push. invalid response from app server " + response); } }); }); @@ -73,18 +72,19 @@ public class PushManagementService { } private void retrieveFcmInstanceToken(final OnGcmInstanceTokenRetrieved instanceTokenRetrieved) { - final FirebaseInstanceId firebaseInstanceId; + final FirebaseMessaging firebaseMessaging; try { - firebaseInstanceId = FirebaseInstanceId.getInstance(); + firebaseMessaging = FirebaseMessaging.getInstance(); + ; } catch (IllegalStateException e) { - Log.d(Config.LOGTAG, "unable to get firebase instance token ",e); + Log.d(Config.LOGTAG, "unable to get firebase instance token ", e); return; } - firebaseInstanceId.getInstanceId().addOnCompleteListener(task -> { + firebaseMessaging.getToken().addOnCompleteListener(task -> { if (!task.isSuccessful()) { Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException()); } - final InstanceIdResult result; + final String result; try { result = task.getResult(); } catch (Exception e) { @@ -92,7 +92,7 @@ public class PushManagementService { return; } if (result != null) { - instanceTokenRetrieved.onGcmInstanceTokenRetrieved(result.getToken()); + instanceTokenRetrieved.onGcmInstanceTokenRetrieved(result); } });