Add some additional FCM logging.

This commit is contained in:
Greyson Parrelli 2019-02-06 00:16:51 -08:00
parent 7da73bbc30
commit c364345e1d
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -91,6 +91,10 @@ public class FcmRefreshJob extends ContextJob implements InjectableType {
Optional<String> 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());