Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add ability to hide the log for an api call #1099

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions main/src/main/java/de/blinkt/openvpn/api/RemoteAction.java
Expand Up @@ -24,6 +24,7 @@
public class RemoteAction extends Activity {

public static final String EXTRA_NAME = "de.blinkt.openvpn.api.profileName";
public static final String EXTRA_HIDELOG = "de.blinkt.openvpn.api.showNoLogWindow";
private ExternalAppDatabase mExtAppDb;
private boolean mDoDisconnect;
private IOpenVPNServiceInternal mService;
Expand Down Expand Up @@ -78,12 +79,14 @@ private void performAction() throws RemoteException {
mService.stopVPN(false);
} else if (component.getShortClassName().equals(".api.ConnectVPN")) {
String vpnName = intent.getStringExtra(EXTRA_NAME);
boolean showLog = intent.getBooleanExtra(EXTRA_HIDELOG, false);
VpnProfile profile = ProfileManager.getInstance(this).getProfileByName(vpnName);
if (profile == null) {
Toast.makeText(this, String.format("Vpn profile %s from API call not found", vpnName), Toast.LENGTH_LONG).show();
} else {
Intent startVPN = new Intent(this, LaunchVPN.class);
startVPN.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUID().toString());
startVPN.putExtra(LaunchVPN.EXTRA_HIDELOG, showLog);
startVPN.setAction(Intent.ACTION_MAIN);
startActivity(startVPN);
}
Expand Down