implement start on boot

sigsegv_dump
Greg Alexander 9 years ago
parent 3112a7ecb3
commit 3620b17411

@ -6,6 +6,7 @@
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application android:label="SimpleSSHD">
<activity android:name="SimpleSSHD" android:label="SimpleSSHD">
<intent-filter>
@ -16,5 +17,10 @@
<activity android:name="Settings" android:label="Settings" />
<service android:name="SimpleSSHDService"
android:label="SimpleSSHDService" />
<receiver android:name="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
</manifest>

@ -72,8 +72,6 @@ it uses select(), I'm not sure how I would honor Thread.interrupt() or
whatever. It's not guaranteed to interrupt select(), and I'm not keen on
adding an arbitrary timeout/polling feature to it.
XXX - implement start on boot
XXX - scp
XXX - zlib
XXX - rsync

@ -0,0 +1,15 @@
package org.galexander.sshd;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.Context;
public class BootReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
Prefs.init(context);
if (Prefs.get_onboot()) {
context.startService(new Intent(context,
SimpleSSHDService.class));
}
}
}
Loading…
Cancel
Save