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