mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
parent
bdcfabf1ee
commit
b110c8a2cb
@ -78,7 +78,6 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
initializeDeveloperBuild();
|
||||
initializeRandomNumberFix();
|
||||
initializeLogging();
|
||||
initializeDependencyInjection();
|
||||
@ -109,15 +108,6 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
return expiringMessageManager;
|
||||
}
|
||||
|
||||
private void initializeDeveloperBuild() {
|
||||
if (BuildConfig.DEV_BUILD) {
|
||||
StrictMode.setThreadPolicy(new ThreadPolicy.Builder().detectAll()
|
||||
.penaltyLog()
|
||||
.build());
|
||||
StrictMode.setVmPolicy(new VmPolicy.Builder().detectAll().penaltyLog().build());
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeRandomNumberFix() {
|
||||
PRNGFixes.apply();
|
||||
}
|
||||
@ -150,9 +140,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
}
|
||||
|
||||
private void initializeGcmCheck() {
|
||||
if (TextSecurePreferences.isPushRegistered(this) &&
|
||||
TextSecurePreferences.getGcmRegistrationId(this) == null)
|
||||
{
|
||||
if (TextSecurePreferences.isPushRegistered(this)) {
|
||||
this.jobManager.add(new GcmRefreshJob(this));
|
||||
}
|
||||
}
|
||||
|
@ -62,10 +62,7 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
|
||||
public void onRun() throws Exception {
|
||||
if (TextSecurePreferences.isGcmDisabled(context)) return;
|
||||
|
||||
String registrationId = TextSecurePreferences.getGcmRegistrationId(context);
|
||||
|
||||
if (registrationId == null) {
|
||||
Log.w(TAG, "GCM registrationId expired, reregistering...");
|
||||
Log.w(TAG, "Reregistering GCM...");
|
||||
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context);
|
||||
|
||||
if (result != ConnectionResult.SUCCESS) {
|
||||
@ -84,7 +81,6 @@ public class GcmRefreshJob extends ContextJob implements InjectableType {
|
||||
TextSecurePreferences.setWebsocketRegistered(context, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCanceled() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user