Search in sources :

Example 11 with BTEngine

use of com.frostwire.bittorrent.BTEngine in project frostwire by frostwire.

the class VPNDropGuard method onStatusUpdated.

@Override
public void onStatusUpdated(boolean vpnIsOn) {
    boolean vpnDropProtectionOn = ConnectionSettings.VPN_DROP_PROTECTION.getValue();
    BTEngine instance = BTEngine.getInstance();
    if (vpnDropProtectionOn) {
        if (vpnIsOn && instance.isPaused()) {
            instance.resume();
        }
        if (!vpnIsOn && !instance.isPaused()) {
            instance.pause();
        }
    } else if (!vpnDropProtectionOn && instance.isPaused()) {
        instance.resume();
    }
}
Also used : BTEngine(com.frostwire.bittorrent.BTEngine)

Example 12 with BTEngine

use of com.frostwire.bittorrent.BTEngine in project frostwire by frostwire.

the class StatusLine method updateFirewall.

/**
 * Updates the firewall text.
 */
private void updateFirewall() {
    try {
        BTEngine engine = BTEngine.getInstance();
        updateFirewallLabel(!engine.isFirewalled());
    } catch (Throwable ignored) {
    }
}
Also used : BTEngine(com.frostwire.bittorrent.BTEngine)

Aggregations

BTEngine (com.frostwire.bittorrent.BTEngine)12 File (java.io.File)3 BTDownload (com.frostwire.bittorrent.BTDownload)2 BTEngineAdapter (com.frostwire.bittorrent.BTEngineAdapter)2 SwitchPreferenceCompat (android.support.v7.preference.SwitchPreferenceCompat)1 ConfigurationManager (com.frostwire.android.core.ConfigurationManager)1 BTContext (com.frostwire.bittorrent.BTContext)1 SkinMenu (com.frostwire.gui.theme.SkinMenu)1 BittorrentDownload (com.frostwire.transfers.BittorrentDownload)1 Random (java.util.Random)1