Lets limit GCM refresh to every 6hrs, and only retry once

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-03-17 10:28:06 -07:00
parent deb96646a3
commit 0d11b3dd26
3 changed files with 21 additions and 2 deletions

View File

@@ -49,7 +49,10 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
@Inject transient SignalServiceAccountManager textSecureAccountManager;
public GcmRefreshJob(Context context) {
super(context, JobParameters.newBuilder().withRequirement(new NetworkRequirement(context)).create());
super(context, JobParameters.newBuilder()
.withRequirement(new NetworkRequirement(context))
.withRetryCount(1)
.create());
}
@Override
@@ -69,6 +72,7 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
textSecureAccountManager.setGcmId(Optional.of(gcmId));
TextSecurePreferences.setGcmRegistrationId(context, gcmId);
TextSecurePreferences.setGcmRegistrationIdLastSetTime(context, System.currentTimeMillis());
TextSecurePreferences.setWebsocketRegistered(context, true);
}
}