Java Code Examples for de.blinkt.openvpn.core.VpnStatus#clearLog()

The following examples show how to use de.blinkt.openvpn.core.VpnStatus#clearLog() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LaunchVPN.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
protected void startVpnFromIntent() {
    // Resolve the intent

    final Intent intent = getIntent();
    final String action = intent.getAction();

    // If the intent is a request to create a shortcut, we'll do that and exit


    if (Intent.ACTION_MAIN.equals(action)) {
        // Check if we need to clear the log
        if (Preferences.getDefaultSharedPreferences(this).getBoolean(CLEARLOG, true))
            VpnStatus.clearLog();

        // we got called to be the starting point, most likely a shortcut
        mhideLog = intent.getBooleanExtra(EXTRA_HIDELOG, false);
        VpnProfile profileToConnect = (VpnProfile) intent.getExtras().getSerializable(PROVIDER_PROFILE);

        if (profileToConnect == null) {
            VpnStatus.logError(R.string.shortcut_profile_notfound);
            // show Log window to display error
            showLogWindow();
            finish();
        } else {
            mSelectedProfile = profileToConnect;
            launchVPN();
        }
    }
}
 
Example 2
Source File: LogFragment.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
void clearLog() {
    // Actually is probably called from GUI Thread as result of the user
    // pressing a button. But better safe than sorry
    VpnStatus.clearLog();
    VpnStatus.logInfo(R.string.logCleared);
    mHandler.sendEmptyMessage(MESSAGE_CLEARLOG);
}