GoBackend: setConfigureIntent does nothing
It's only used from the ManageDialog in VpnDialogs, which in turn is only instantiated in the legacy VPN path. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
6f1e86e8a7
commit
314a0d124d
@ -93,11 +93,7 @@ public class Application extends android.app.Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (backend == null) {
|
if (backend == null) {
|
||||||
final Context context = app.getApplicationContext();
|
backend = new GoBackend(app.getApplicationContext());
|
||||||
final Intent configureIntent = new Intent(context, MainActivity.class);
|
|
||||||
configureIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
final PendingIntent pendingConfigureIntent = PendingIntent.getActivity(context, 0, configureIntent, 0);
|
|
||||||
backend = new GoBackend(context, pendingConfigureIntent);
|
|
||||||
GoBackend.setAlwaysOnCallback(() -> {
|
GoBackend.setAlwaysOnCallback(() -> {
|
||||||
get().tunnelManager.restoreState(true).whenComplete(ExceptionLoggers.D);
|
get().tunnelManager.restoreState(true).whenComplete(ExceptionLoggers.D);
|
||||||
});
|
});
|
||||||
|
@ -44,17 +44,15 @@ public final class GoBackend implements Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final PendingIntent configurationIntent;
|
|
||||||
@Nullable private Tunnel currentTunnel;
|
@Nullable private Tunnel currentTunnel;
|
||||||
@Nullable private Config currentConfig;
|
@Nullable private Config currentConfig;
|
||||||
private int currentTunnelHandle = -1;
|
private int currentTunnelHandle = -1;
|
||||||
|
|
||||||
private final Set<TunnelStateChangeNotificationReceiver> notifiers = new HashSet<>();
|
private final Set<TunnelStateChangeNotificationReceiver> notifiers = new HashSet<>();
|
||||||
|
|
||||||
public GoBackend(final Context context, final PendingIntent configurationIntent) {
|
public GoBackend(final Context context) {
|
||||||
SharedLibraryLoader.loadSharedLibrary(context, "wg-go");
|
SharedLibraryLoader.loadSharedLibrary(context, "wg-go");
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.configurationIntent = configurationIntent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native String wgGetConfig(int handle);
|
private static native String wgGetConfig(int handle);
|
||||||
@ -194,8 +192,6 @@ public final class GoBackend implements Backend {
|
|||||||
final VpnService.Builder builder = service.getBuilder();
|
final VpnService.Builder builder = service.getBuilder();
|
||||||
builder.setSession(tunnel.getName());
|
builder.setSession(tunnel.getName());
|
||||||
|
|
||||||
builder.setConfigureIntent(configurationIntent);
|
|
||||||
|
|
||||||
for (final String excludedApplication : config.getInterface().getExcludedApplications())
|
for (final String excludedApplication : config.getInterface().getExcludedApplications())
|
||||||
builder.addDisallowedApplication(excludedApplication);
|
builder.addDisallowedApplication(excludedApplication);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user