Remove readfile callback

This commit is contained in:
Paul Rouget 2019-02-06 07:20:17 +01:00
parent b7e9bab267
commit 475756ec2f
6 changed files with 42 additions and 119 deletions

View file

@ -111,7 +111,6 @@ android {
sourceSets {
main {
assets.srcDirs = [rootDir.absolutePath + "/../../../target/android/resources"]
}
armDebug {
jniLibs.srcDirs = [getJniLibsPath(true, 'arm')]

View file

@ -97,8 +97,6 @@ public class JNIServo {
void onHistoryChanged(boolean canGoBack, boolean canGoForward);
void onShutdownComplete();
byte[] readfile(String file);
}
}

View file

@ -6,12 +6,9 @@
package org.mozilla.servoview;
import android.app.Activity;
import android.content.res.AssetManager;
import android.content.Context;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
@ -20,7 +17,6 @@ import org.mozilla.servoview.JNIServo.ServoOptions;
public class Servo {
private static final String LOGTAG = "Servo";
private AssetManager mAssetMgr;
private JNIServo mJNI = new JNIServo();
private RunCallback mRunCallback;
private boolean mShuttingDown;
@ -37,8 +33,6 @@ public class Servo {
mRunCallback = runCallback;
mAssetMgr = activity.getResources().getAssets();
mServoCallbacks = new Callbacks(client, gfxcb);
mRunCallback.inGLThread(() -> {
@ -262,18 +256,5 @@ public class Servo {
public void onRedrawing(boolean redrawing) {
mRunCallback.inUIThread(() -> mClient.onRedrawing(redrawing));
}
public byte[] readfile(String file) {
try {
InputStream stream = mAssetMgr.open(file);
byte[] bytes = new byte[stream.available()];
stream.read(bytes);
stream.close();
return bytes;
} catch (IOException e) {
Log.e(LOGTAG, "readfile error: " + e.getMessage());
return null;
}
}
}
}