mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 05:21:34 +00:00
FCM improvements.
This commit is contained in:
@@ -91,8 +91,13 @@ 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.");
|
||||
String oldToken = TextSecurePreferences.getFcmToken(context);
|
||||
|
||||
if (!token.get().equals(oldToken)) {
|
||||
int oldLength = oldToken != null ? oldToken.length() : -1;
|
||||
Log.i(TAG, "Token changed. oldLength: " + oldLength + " newLength: " + token.get().length());
|
||||
} else {
|
||||
Log.i(TAG, "Token didn't change.");
|
||||
}
|
||||
|
||||
textSecureAccountManager.setGcmId(token);
|
||||
|
||||
Reference in New Issue
Block a user