From: Tobias Brunner Date: Fri, 30 May 2014 15:40:24 +0000 (+0200) Subject: android: Only close TrustedCertificatesActivity on click when selecting a certificate X-Git-Tag: 5.2.1dr1~117^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1353f08fbc7729a2dfc0be9cf0b8de67598941a8;p=thirdparty%2Fstrongswan.git android: Only close TrustedCertificatesActivity on click when selecting a certificate --- diff --git a/src/frontends/android/src/org/strongswan/android/ui/TrustedCertificatesActivity.java b/src/frontends/android/src/org/strongswan/android/ui/TrustedCertificatesActivity.java index eab290f834..34f3d062a6 100644 --- a/src/frontends/android/src/org/strongswan/android/ui/TrustedCertificatesActivity.java +++ b/src/frontends/android/src/org/strongswan/android/ui/TrustedCertificatesActivity.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Tobias Brunner + * Copyright (C) 2012-2014 Tobias Brunner * Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import android.view.MenuItem; public class TrustedCertificatesActivity extends Activity implements TrustedCertificateListFragment.OnTrustedCertificateSelectedListener { public static final String SELECT_CERTIFICATE = "org.strongswan.android.action.SELECT_CERTIFICATE"; + private boolean mSelect; @Override public void onCreate(Bundle savedInstanceState) @@ -60,6 +61,7 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert { actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0)); } + mSelect = SELECT_CERTIFICATE.equals(getIntent().getAction()); } @Override @@ -84,11 +86,14 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert @Override public void onTrustedCertificateSelected(TrustedCertificateEntry selected) { - /* the user selected a certificate, return to calling activity */ - Intent intent = new Intent(); - intent.putExtra(VpnProfileDataSource.KEY_CERTIFICATE, selected.getAlias()); - setResult(Activity.RESULT_OK, intent); - finish(); + if (mSelect) + { + /* the user selected a certificate, return to calling activity */ + Intent intent = new Intent(); + intent.putExtra(VpnProfileDataSource.KEY_CERTIFICATE, selected.getAlias()); + setResult(Activity.RESULT_OK, intent); + finish(); + } } public static class TrustedCertificatesTabListener implements ActionBar.TabListener