Revert "IPNReceiver: Add intents to connect and disconnect VPN (#84)"

Reverting according to discussion in
https://github.com/tailscale/tailscale/issues/3547#issuecomment-1465035410

This reverts commit 51a53e5472.
release-branch/1.38
Denton Gentry 2 years ago
parent 6499fb845e
commit d0c45c1de1

@ -55,13 +55,6 @@
<data android:mimeType="video/*" /> <data android:mimeType="video/*" />
</intent-filter> </intent-filter>
</activity> </activity>
<receiver android:name="IPNReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.tailscale.ipn.CONNECT_VPN" />
<action android:name="com.tailscale.ipn.DISCONNECT_VPN" />
</intent-filter>
</receiver>
<service android:name=".IPNService" <service android:name=".IPNService"
android:permission="android.permission.BIND_VPN_SERVICE" android:permission="android.permission.BIND_VPN_SERVICE"
android:exported="false"> android:exported="false">

@ -1,20 +0,0 @@
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();
}

@ -102,16 +102,6 @@ func Java_com_tailscale_ipn_IPNService_disconnect(env *C.JNIEnv, this C.jobject)
onDisconnect <- jni.NewGlobalRef(jenv, jni.Object(this)) onDisconnect <- jni.NewGlobalRef(jenv, jni.Object(this))
} }
//export Java_com_tailscale_ipn_IPNReceiver_connect
func Java_com_tailscale_ipn_IPNReceiver_connect(env *C.JNIEnv, this C.jobject) {
requestBackend(ConnectEvent{Enable: true})
}
//export Java_com_tailscale_ipn_IPNReceiver_disconnect
func Java_com_tailscale_ipn_IPNReceiver_disconnect(env *C.JNIEnv, this C.jobject) {
requestBackend(ConnectEvent{Enable: false})
}
//export Java_com_tailscale_ipn_App_onConnectivityChanged //export Java_com_tailscale_ipn_App_onConnectivityChanged
func Java_com_tailscale_ipn_App_onConnectivityChanged(env *C.JNIEnv, cls C.jclass, connected C.jboolean) { func Java_com_tailscale_ipn_App_onConnectivityChanged(env *C.JNIEnv, cls C.jclass, connected C.jboolean) {
select { select {

Loading…
Cancel
Save