Skip to content
Snippets Groups Projects
Commit 46863b8c authored by akwizgran's avatar akwizgran
Browse files

Log how long it takes Guice to construct its object graph.

parent bd980f67
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,13 @@ package org.briarproject.android;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.view.Gravity.CENTER;
import static java.util.logging.Level.INFO;
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
import java.util.logging.Logger;
import org.briarproject.api.db.DatabaseConfig;
import roboguice.RoboGuice;
import roboguice.activity.RoboSplashActivity;
import android.content.Intent;
......@@ -15,6 +20,11 @@ import com.google.inject.Injector;
public class SplashScreenActivity extends RoboSplashActivity {
private static final Logger LOG =
Logger.getLogger(SplashScreenActivity.class.getName());
private long start = System.currentTimeMillis();
public SplashScreenActivity() {
minDisplayMs = 0;
}
......@@ -32,6 +42,9 @@ public class SplashScreenActivity extends RoboSplashActivity {
}
protected void startNextActivity() {
long duration = System.currentTimeMillis() - start;
if(LOG.isLoggable(INFO))
LOG.info("Guice startup took " + duration + " ms");
Injector guice = RoboGuice.getBaseApplicationInjector(getApplication());
if(guice.getInstance(DatabaseConfig.class).databaseExists()) {
Intent i = new Intent(this, HomeScreenActivity.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment