You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale-android/android/src/main/java/com/tailscale/ipn/IPNReceiver.java

21 lines
551 B
Java

package com.tailscale.ipn;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class IPNReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == "com.tailscale.ipn.CONNECT_VPN") {
connect();
} else if (intent.getAction() == "com.tailscale.ipn.DISCONNECT_VPN") {
disconnect();
}
}
private native void connect();
private native void disconnect();
}