Browse Source

Removing unnecessary executor

master
anthony restaino 8 years ago
parent
commit
c1e8943a7f
  1. 7
      app/src/main/java/acr/browser/lightning/app/BrowserApp.java
  2. 4
      app/src/main/java/acr/browser/lightning/utils/FileUtils.java

7
app/src/main/java/acr/browser/lightning/app/BrowserApp.java

@ -40,9 +40,7 @@ public class BrowserApp extends Application {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT); AppCompatDelegate.setCompatVectorFromResourcesEnabled(Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT);
} }
@Nullable private static AppComponent sAppComponent; @Nullable private static AppComponent sAppComponent;
private static final Executor mIOThread = Executors.newSingleThreadExecutor();
@Inject PreferenceManager mPreferenceManager; @Inject PreferenceManager mPreferenceManager;
@Inject BookmarkModel mBookmarkModel; @Inject BookmarkModel mBookmarkModel;
@ -125,11 +123,6 @@ public class BrowserApp extends Application {
return sAppComponent; return sAppComponent;
} }
@NonNull
public static Executor getIOThread() {
return mIOThread;
}
/** /**
* Determines whether this is a release build. * Determines whether this is a release build.
* *

4
app/src/main/java/acr/browser/lightning/utils/FileUtils.java

@ -8,6 +8,8 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.util.Log; import android.util.Log;
import com.anthonycr.bonsai.Schedulers;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
@ -38,7 +40,7 @@ public class FileUtils {
* @param name the name of the file to store the bundle in. * @param name the name of the file to store the bundle in.
*/ */
public static void writeBundleToStorage(final @NonNull Application app, final Bundle bundle, final @NonNull String name) { public static void writeBundleToStorage(final @NonNull Application app, final Bundle bundle, final @NonNull String name) {
BrowserApp.getIOThread().execute(new Runnable() { Schedulers.io().execute(new Runnable() {
@Override @Override
public void run() { public void run() {
File outputFile = new File(app.getFilesDir(), name); File outputFile = new File(app.getFilesDir(), name);

Loading…
Cancel
Save