From c364345e1d2bac6436ab76566958cd724a499e5a Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 6 Feb 2019 00:16:51 -0800 Subject: [PATCH] Add some additional FCM logging. --- src/org/thoughtcrime/securesms/gcm/FcmService.java | 2 ++ src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/org/thoughtcrime/securesms/gcm/FcmService.java b/src/org/thoughtcrime/securesms/gcm/FcmService.java index ff87c158fd..f5e3f748a5 100644 --- a/src/org/thoughtcrime/securesms/gcm/FcmService.java +++ b/src/org/thoughtcrime/securesms/gcm/FcmService.java @@ -50,6 +50,8 @@ public class FcmService extends FirebaseMessagingService implements InjectableTy @Override public void onNewToken(String token) { + Log.i(TAG, "onNewToken()"); + if (!TextSecurePreferences.isPushRegistered(getApplicationContext())) { Log.i(TAG, "Got a new FCM token, but the user isn't registered."); return; diff --git a/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java b/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java index f514b17ec2..0a3dad145d 100644 --- a/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java +++ b/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java @@ -91,6 +91,10 @@ public class FcmRefreshJob extends ContextJob implements InjectableType { Optional token = FcmUtil.getToken(); if (token.isPresent()) { + if (!token.get().equals(TextSecurePreferences.getFcmToken(context))) { + Log.i(TAG, "New token differs from the old token."); + } + textSecureAccountManager.setGcmId(token); TextSecurePreferences.setFcmToken(context, token.get()); TextSecurePreferences.setFcmTokenLastSetTime(context, System.currentTimeMillis());