Enable use of RUST_LOG with mach run --android.

This commit is contained in:
Josh Matthews 2018-09-20 14:14:41 -04:00
parent a6dbfdd29f
commit f7516f57a7
7 changed files with 31 additions and 15 deletions

View file

@ -71,7 +71,8 @@ public class MainActivity extends Activity implements Servo.Client {
}
String args = getIntent().getStringExtra("servoargs");
mServoView.setServoArgs(args);
String log = getIntent().getStringExtra("servolog");
mServoView.setServoArgs(args, log);
setupUrlField();
}

View file

@ -22,6 +22,7 @@ public class JNIServo {
public native void init(Activity activity,
String args,
String url,
String logstr,
Callbacks callbacks,
int width, int height, boolean log);

View file

@ -24,7 +24,9 @@ public class Servo {
GfxCallbacks gfxcb,
Client client,
Activity activity,
String args, String url,
String args,
String url,
String logstr,
int width, int height, boolean log) {
mRunCallback = runCallback;
@ -34,7 +36,7 @@ public class Servo {
Callbacks cbs = new Callbacks(client, gfxcb);
mRunCallback.inGLThread(() -> {
mJNI.init(activity, args, url, cbs, width, height, log);
mJNI.init(activity, args, url, logstr, cbs, width, height, log);
});
}

View file

@ -38,6 +38,7 @@ public class ServoSurface {
private Servo mServo;
private Client mClient = null;
private String mServoArgs = "";
private String mServoLog = "";
private String mInitialUri = null;
private Activity mActivity;
@ -53,8 +54,9 @@ public class ServoSurface {
mClient = client;
}
public void setServoArgs(String args) {
public void setServoArgs(String args, String log) {
mServoArgs = args != null ? args : "";
mServoLog = log != null ? log : "";
}
public void setActivity(Activity activity) {
@ -204,7 +206,7 @@ public class ServoSurface {
inUIThread(() -> {
final boolean showLogs = true;
String uri = mInitialUri == null ? null : mInitialUri;
mServo = new Servo(this, surface, mClient, mActivity, mServoArgs, uri, mWidth, mHeight, showLogs);
mServo = new Servo(this, surface, mClient, mActivity, mServoArgs, uri, mServoLog, mWidth, mHeight, showLogs);
});
Looper.loop();

View file

@ -41,6 +41,7 @@ public class ServoView extends GLSurfaceView
private Uri mInitialUri = null;
private boolean mAnimating;
private String mServoArgs = "";
private String mServoLog = "";
private GestureDetector mGestureDetector;
private ScaleGestureDetector mScaleGestureDetector;
@ -72,8 +73,9 @@ public class ServoView extends GLSurfaceView
initGestures(context);
}
public void setServoArgs(String args) {
public void setServoArgs(String args, String log) {
mServoArgs = args != null ? args : "";
mServoLog = log != null ? log : "";
}
public void reload() {
@ -139,7 +141,7 @@ public class ServoView extends GLSurfaceView
int height = getHeight();
inGLThread(() -> {
String uri = mInitialUri == null ? null : mInitialUri.toString();
mServo = new Servo(this, this, mClient, mActivity, mServoArgs, uri, width, height, showLogs);
mServo = new Servo(this, this, mClient, mActivity, mServoArgs, uri, mServoLog, width, height, showLogs);
});
}