mirror of
http://galexander.org/git/simplesshd.git
synced 2024-11-27 01:38:11 +00:00
implement start on boot
This commit is contained in:
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>
|
||||
|
2
NOTES
2
NOTES
@ -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
|
||||
|
15
src/org/galexander/sshd/BootReceiver.java
Normal file
15
src/org/galexander/sshd/BootReceiver.java
Normal file
@ -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…
Reference in New Issue
Block a user