summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/fragments
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-06-23 17:09:52 +0200
committerArne Schwabe <arne@rfc2549.org>2013-06-23 17:09:52 +0200
commit0e76e955ba4848b18ee458cb9f53cc8e64671146 (patch)
tree818cb149d78d508dcc34fa6cdfc3e94e3655db4b /src/de/blinkt/openvpn/fragments
parent180642560ef5c8a0139dcd50c1a7fa949c0c20f4 (diff)
Fix issues found by Code Analysis
Diffstat (limited to 'src/de/blinkt/openvpn/fragments')
-rw-r--r--src/de/blinkt/openvpn/fragments/AboutFragment.java6
-rw-r--r--src/de/blinkt/openvpn/fragments/FaqFragment.java6
-rw-r--r--src/de/blinkt/openvpn/fragments/FileSelectionFragment.java5
-rw-r--r--src/de/blinkt/openvpn/fragments/GeneralSettings.java6
-rw-r--r--src/de/blinkt/openvpn/fragments/Settings_Authentication.java2
-rw-r--r--src/de/blinkt/openvpn/fragments/Settings_Basic.java7
-rw-r--r--src/de/blinkt/openvpn/fragments/Settings_IP.java4
-rw-r--r--src/de/blinkt/openvpn/fragments/ShowConfigFragment.java4
8 files changed, 8 insertions, 32 deletions
diff --git a/src/de/blinkt/openvpn/fragments/AboutFragment.java b/src/de/blinkt/openvpn/fragments/AboutFragment.java
index a0ee9928..54bd3667 100644
--- a/src/de/blinkt/openvpn/fragments/AboutFragment.java
+++ b/src/de/blinkt/openvpn/fragments/AboutFragment.java
@@ -16,12 +16,6 @@ import de.blinkt.openvpn.R;
public class AboutFragment extends Fragment {
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- }
-
- @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v= inflater.inflate(R.layout.about, container, false);
diff --git a/src/de/blinkt/openvpn/fragments/FaqFragment.java b/src/de/blinkt/openvpn/fragments/FaqFragment.java
index 459f2369..3aa84fd7 100644
--- a/src/de/blinkt/openvpn/fragments/FaqFragment.java
+++ b/src/de/blinkt/openvpn/fragments/FaqFragment.java
@@ -13,12 +13,6 @@ import de.blinkt.openvpn.R;
public class FaqFragment extends Fragment {
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- }
-
- @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v= inflater.inflate(R.layout.faq, container, false);
diff --git a/src/de/blinkt/openvpn/fragments/FileSelectionFragment.java b/src/de/blinkt/openvpn/fragments/FileSelectionFragment.java
index 864f24ce..e0c97620 100644
--- a/src/de/blinkt/openvpn/fragments/FileSelectionFragment.java
+++ b/src/de/blinkt/openvpn/fragments/FileSelectionFragment.java
@@ -59,7 +59,7 @@ public class FileSelectionFragment extends ListFragment {
mInlineImport = (CheckBox) v.findViewById(R.id.doinline);
- if(mHideImport== true) {
+ if(mHideImport) {
mInlineImport.setVisibility(View.GONE);
mInlineImport.setChecked(false);
}
@@ -95,9 +95,6 @@ public class FileSelectionFragment extends ListFragment {
mClearButton.setEnabled(false);
}
-
-
-
return v;
}
diff --git a/src/de/blinkt/openvpn/fragments/GeneralSettings.java b/src/de/blinkt/openvpn/fragments/GeneralSettings.java
index bf391d29..a78c31f6 100644
--- a/src/de/blinkt/openvpn/fragments/GeneralSettings.java
+++ b/src/de/blinkt/openvpn/fragments/GeneralSettings.java
@@ -76,10 +76,8 @@ public class GeneralSettings extends PreferenceFragment implements OnPreferenceC
private boolean isTunModuleAvailable() {
// Check if the tun module exists on the file system
- if(new File("/system/lib/modules/tun.ko").length() > 10)
- return true;
- return false;
- }
+ return new File("/system/lib/modules/tun.ko").length() > 10;
+ }
@Override
public boolean onPreferenceClick(Preference preference) {
diff --git a/src/de/blinkt/openvpn/fragments/Settings_Authentication.java b/src/de/blinkt/openvpn/fragments/Settings_Authentication.java
index 9ec77f35..592adcb1 100644
--- a/src/de/blinkt/openvpn/fragments/Settings_Authentication.java
+++ b/src/de/blinkt/openvpn/fragments/Settings_Authentication.java
@@ -92,7 +92,7 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
if(mTLSAuthDirection.getValue()==null)
mProfile.mTLSAuthDirection=null;
else
- mProfile.mTLSAuthDirection = mTLSAuthDirection.getValue().toString();
+ mProfile.mTLSAuthDirection = mTLSAuthDirection.getValue();
if(mCipher.getText()==null)
mProfile.mCipher=null;
diff --git a/src/de/blinkt/openvpn/fragments/Settings_Basic.java b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
index ad9a79ad..05e4a2a8 100644
--- a/src/de/blinkt/openvpn/fragments/Settings_Basic.java
+++ b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
@@ -144,12 +144,7 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On
}
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- }
-
- @Override
+ @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (parent == mType) {
changeType(position);
diff --git a/src/de/blinkt/openvpn/fragments/Settings_IP.java b/src/de/blinkt/openvpn/fragments/Settings_IP.java
index 483397d0..674a09d4 100644
--- a/src/de/blinkt/openvpn/fragments/Settings_IP.java
+++ b/src/de/blinkt/openvpn/fragments/Settings_IP.java
@@ -113,10 +113,8 @@ public class Settings_IP extends OpenVpnPreferencesFragment implements OnPrefere
mOverrideDNS.setEnabled(mUsePull.isChecked());
if(!mUsePull.isChecked())
enabled =true;
- else if (mOverrideDNS.isChecked())
- enabled = true;
else
- enabled = false;
+ enabled = mOverrideDNS.isChecked();
mDNS1.setEnabled(enabled);
mDNS2.setEnabled(enabled);
diff --git a/src/de/blinkt/openvpn/fragments/ShowConfigFragment.java b/src/de/blinkt/openvpn/fragments/ShowConfigFragment.java
index 3c76a383..ad077633 100644
--- a/src/de/blinkt/openvpn/fragments/ShowConfigFragment.java
+++ b/src/de/blinkt/openvpn/fragments/ShowConfigFragment.java
@@ -53,9 +53,9 @@ public class ShowConfigFragment extends Fragment {
});
- };
+ }
}.start();
- };
+ }
@Override
public void onCreate(Bundle savedInstanceState) {