예제 #1
0
  @Override
  protected void onStart() {
    super.onStart();
    // 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)) {
      // we got called to be the starting point, most likely a shortcut
      String shortcutUUID = intent.getStringExtra(EXTRA_KEY);
      String shortcutName = intent.getStringExtra(EXTRA_NAME);
      mhideLog = intent.getBooleanExtra(EXTRA_HIDELOG, false);

      VpnProfile profileToConnect = ProfileManager.get(this, shortcutUUID);
      if (shortcutName != null && profileToConnect == null)
        profileToConnect = ProfileManager.getInstance(this).getProfileByName(shortcutName);

      if (profileToConnect == null) {
        VpnStatus.logError(R.string.openvpn_shortcut_profile_notfound);
        // show Log window to display error
        showLogWindow();
        finish();
        return;
      }

      mSelectedProfile = profileToConnect;
      launchVPN();
    }
  }
예제 #2
0
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    mPM = ProfileManager.getInstance(this);
  }