now it compiles...

sigsegv_dump
Greg Alexander 10 years ago
parent 643a5aff23
commit 720007ae32

@ -12,6 +12,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<service android:name="SimpleSSHDService" <service android:name="SimpleSSHDService"
android:label="SimpleSSHDService"> android:label="SimpleSSHDService" />
</application> </application>
</manifest> </manifest>

@ -1,13 +1,15 @@
package org.galexander.sshd; package org.galexander.sshd;
import android.app.Service; import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class SimpleSSHDService extends Service { public class SimpleSSHDService extends Service {
public int sshd_pid = 0; public int sshd_pid = 0;
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
if ((intent == null) || if ((intent == null) ||
(!intent.getBooleanExtra("stop", false)) { (!intent.getBooleanExtra("stop", false))) {
if (is_started()) { if (is_started()) {
stop_sshd(); stop_sshd();
} }
@ -18,13 +20,16 @@ public class SimpleSSHDService extends Service {
return START_NOT_STICKY; return START_NOT_STICKY;
} }
} }
public IBinder onBind(Intent intent) {
return null;
}
public boolean is_started() { public boolean is_started() {
return (sshd_pid != 0); return (sshd_pid != 0);
} }
private native void start_sshd(void); private native void start_sshd();
private native void stop_sshd(void); private native void stop_sshd();
static { static {
System.loadLibrary("simplesshd-jni"); System.loadLibrary("simplesshd-jni");
} }

Loading…
Cancel
Save