summaryrefslogtreecommitdiff
path: root/src/de/blinkt
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-06-05 14:44:12 +0200
committerArne Schwabe <arne@rfc2549.org>2013-06-05 14:44:12 +0200
commitf613db173c88b1d42503eb75f70f98486ee40e95 (patch)
treec175e0b5504d58df9c0f385616d59f437226e536 /src/de/blinkt
parent1e57ad0ef473917864ea1f5983e2ca79932b30c6 (diff)
Fix issues reported by Intellij
Diffstat (limited to 'src/de/blinkt')
-rw-r--r--src/de/blinkt/openvpn/LaunchVPN.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java
index 074bd235..5924e8ff 100644
--- a/src/de/blinkt/openvpn/LaunchVPN.java
+++ b/src/de/blinkt/openvpn/LaunchVPN.java
@@ -63,7 +63,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
public static final String EXTRA_KEY = "de.blinkt.openvpn.shortcutProfileUUID";
public static final String EXTRA_NAME = "de.blinkt.openvpn.shortcutProfileName";
- public static final String EXTRA_HIDELOG = "de.blinkt.openvpn.showNoLogWindow";;
+ public static final String EXTRA_HIDELOG = "de.blinkt.openvpn.showNoLogWindow";
private static final int START_VPN_PROFILE= 70;
@@ -198,12 +198,8 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
VpnProfile profile = mPM.getProfileByName(profilename);
- // if (Intent.ACTION_CREATE_SHORTCUT.equals(action)) {
setupShortcut(profile);
finish();
- return;
- // }
-
}
@@ -224,6 +220,8 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
if (type == R.string.password) {
((EditText)userpwlayout.findViewById(R.id.username)).setText(mSelectedProfile.mUsername);
((EditText)userpwlayout.findViewById(R.id.password)).setText(mSelectedProfile.mPassword);
+ ((CheckBox)userpwlayout.findViewById(R.id.save_password)).setChecked(!TextUtils.isEmpty(mSelectedProfile.mPassword));
+
dialog.setView(userpwlayout);
} else {
dialog.setView(entry);
@@ -235,19 +233,17 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
public void onClick(DialogInterface dialog, int which) {
if (type == R.string.password) {
+ mSelectedProfile.mUsername = ((EditText) userpwlayout.findViewById(R.id.username)).getText().toString();
+
String pw = ((EditText) userpwlayout.findViewById(R.id.password)).getText().toString();
- String username = ((EditText) userpwlayout.findViewById(R.id.username)).getText().toString();
- mSelectedProfile.mUsername = username;
if (((CheckBox) userpwlayout.findViewById(R.id.save_password)).isChecked()) {
- if (pw !=null && !("".equals(pw)))
- mSelectedProfile.mPassword=pw;
+ mSelectedProfile.mPassword=pw;
} else {
mSelectedProfile.mPassword=null;
mSelectedProfile.mTransientPW = pw;
}
} else {
- String pw = entry.getText().toString();
- mSelectedProfile.mTransientPCKS12PW = pw;
+ mSelectedProfile.mTransientPCKS12PW = entry.getText().toString();
}
onActivityResult(START_VPN_PROFILE, Activity.RESULT_OK, null);
@@ -358,7 +354,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
}
private void execeuteSUcmd(String command) {
- ProcessBuilder pb = new ProcessBuilder(new String[] {"su","-c",command});
+ ProcessBuilder pb = new ProcessBuilder("su","-c",command);
try {
Process p = pb.start();
int ret = p.waitFor();