1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-11-17 21:08:28 +00:00
simplesshd/app/src/main/java/org/galexander/sshd/StopReceiver.java
Greg Alexander 823591055a Factor out the idiom for startService() vs startForegroundService(), and
use it in StartReceive/StopReceiver as well as BootReceiver, so that the
sshd service can be started and stopped even if the UI is closed.
2019-09-01 15:42:09 -04:00

14 lines
389 B
Java

package org.galexander.sshd;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.Context;
public class StopReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
SimpleSSHDService.my_startService(context,
new Intent(context, SimpleSSHDService.class)
.putExtra("stop", true));
}
}