Esempio n. 1
0
    @Override
    public void onLaunched(boolean isVpnMode) {
        isLaunched = true;
        ActivityCompat.invalidateOptionsMenu(this);

        ImageView star = (ImageView) findViewById(R.id.star);
        stopBlinkingImage(star);
        enableImage(star);
        stopBlinkingStatus();

        startBlinkingImage((ImageView) findViewById(R.id.freeInternetArrow));
        startBlinkingStatus(_(R.string.status_free_internet_connecting));
        if (isVpnMode) {
            clearNotification();
            if (LaunchService.isVpnRunning()) {
                onFreeInternetChanged(true);
            } else {
                startVpn();
            }
        } else {
            if (ApkUtils.isInstalled(this, "fq.router")) {
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        ApkUtils.uninstall(MainActivity.this, "fq.router");
                    }
                }).start();
            }
            checkWifiRepeater();
            checkPickAndPlay();
            ConnectFreeInternetService.execute(this);
        }
    }
Esempio n. 2
0
 private void toggleFreeInternet(ToggleButton button) {
     startBlinkingImage((ImageView) findViewById(R.id.freeInternetArrow));
     if (button.isChecked()) {
         startBlinkingStatus(_(R.string.status_free_internet_connecting));
         disableFreeInternetButton();
         ConnectFreeInternetService.execute(this);
     } else {
         startBlinkingStatus(_(R.string.status_free_internet_disconnecting));
         disableFreeInternetButton();
         DisconnectFreeInternetService.execute(this);
     }
 }