mirror of
http://galexander.org/git/simplesshd.git
synced 2025-01-01 02:40:52 +00:00
add org.galexander.sshd.START and org.galexander.sshd.STOP broadcast receiver
This commit is contained in:
parent
e07a809980
commit
ebbdac1787
@ -25,5 +25,17 @@
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name="StartReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="org.galexander.sshd.START" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name="StopReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="org.galexander.sshd.STOP" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
12
app/src/main/java/org/galexander/sshd/StartReceiver.java
Normal file
12
app/src/main/java/org/galexander/sshd/StartReceiver.java
Normal file
@ -0,0 +1,12 @@
|
||||
package org.galexander.sshd;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Intent;
|
||||
import android.content.Context;
|
||||
|
||||
public class StartReceiver extends BroadcastReceiver {
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
context.startService(
|
||||
new Intent(context, SimpleSSHDService.class));
|
||||
}
|
||||
}
|
13
app/src/main/java/org/galexander/sshd/StopReceiver.java
Normal file
13
app/src/main/java/org/galexander/sshd/StopReceiver.java
Normal file
@ -0,0 +1,13 @@
|
||||
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) {
|
||||
context.startService(
|
||||
new Intent(context, SimpleSSHDService.class)
|
||||
.putExtra("stop", true));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user