Switch from GCM to FCM.

This commit is contained in:
Greyson Parrelli
2019-01-24 03:04:28 -08:00
parent ebe8d38a91
commit d482c60a98
15 changed files with 216 additions and 111 deletions

View File

@@ -388,11 +388,11 @@ public class TextSecurePreferences {
return getBooleanPreference(context, ALWAYS_RELAY_CALLS_PREF, false);
}
public static boolean isGcmDisabled(Context context) {
public static boolean isFcmDisabled(Context context) {
return getBooleanPreference(context, GCM_DISABLED_PREF, false);
}
public static void setGcmDisabled(Context context, boolean disabled) {
public static void setFcmDisabled(Context context, boolean disabled) {
setBooleanPreference(context, GCM_DISABLED_PREF, disabled);
}
@@ -486,12 +486,12 @@ public class TextSecurePreferences {
setBooleanPreference(context, SIGNED_PREKEY_REGISTERED_PREF, value);
}
public static void setGcmRegistrationId(Context context, String registrationId) {
public static void setFcmToken(Context context, String registrationId) {
setStringPreference(context, GCM_REGISTRATION_ID_PREF, registrationId);
setIntegerPrefrence(context, GCM_REGISTRATION_ID_VERSION_PREF, Util.getCurrentApkReleaseVersion(context));
}
public static String getGcmRegistrationId(Context context) {
public static String getFcmToken(Context context) {
int storedRegistrationIdVersion = getIntegerPreference(context, GCM_REGISTRATION_ID_VERSION_PREF, 0);
if (storedRegistrationIdVersion != Util.getCurrentApkReleaseVersion(context)) {
@@ -501,11 +501,11 @@ public class TextSecurePreferences {
}
}
public static long getGcmRegistrationIdLastSetTime(Context context) {
public static long getFcmTokenLastSetTime(Context context) {
return getLongPreference(context, GCM_REGISTRATION_ID_TIME_PREF, 0);
}
public static void setGcmRegistrationIdLastSetTime(Context context, long timestamp) {
public static void setFcmTokenLastSetTime(Context context, long timestamp) {
setLongPreference(context, GCM_REGISTRATION_ID_TIME_PREF, timestamp);
}