mirror of
http://galexander.org/git/simplesshd.git
synced 2024-11-30 11:18:12 +00:00
add a (useless) service onDestroy() to clean up the sshd
This commit is contained in:
parent
f3f53709c6
commit
5248db4380
@ -26,10 +26,21 @@ public class SimpleSSHDService extends Service {
|
|||||||
return START_NOT_STICKY;
|
return START_NOT_STICKY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBinder onBind(Intent intent) {
|
public IBinder onBind(Intent intent) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* unfortunately, android doesn't reliably call this when, i.e.,
|
||||||
|
* the package is upgraded... so it's really pretty useless */
|
||||||
|
public void onDestroy() {
|
||||||
|
if (is_started()) {
|
||||||
|
stop_sshd();
|
||||||
|
}
|
||||||
|
stopSelf();
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean is_started() {
|
public static boolean is_started() {
|
||||||
return (sshd_pid != 0);
|
return (sshd_pid != 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user