summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/api
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/api
parent180642560ef5c8a0139dcd50c1a7fa949c0c20f4 (diff)
Fix issues found by Code Analysis
Diffstat (limited to 'src/de/blinkt/openvpn/api')
-rw-r--r--src/de/blinkt/openvpn/api/APIVpnProfile.java5
-rw-r--r--src/de/blinkt/openvpn/api/ExternalAppDatabase.java5
-rw-r--r--src/de/blinkt/openvpn/api/ExternalOpenVPNService.java7
3 files changed, 7 insertions, 10 deletions
diff --git a/src/de/blinkt/openvpn/api/APIVpnProfile.java b/src/de/blinkt/openvpn/api/APIVpnProfile.java
index dfcccf36..f5591764 100644
--- a/src/de/blinkt/openvpn/api/APIVpnProfile.java
+++ b/src/de/blinkt/openvpn/api/APIVpnProfile.java
@@ -12,10 +12,7 @@ public class APIVpnProfile implements Parcelable {
public APIVpnProfile(Parcel in) {
mUUID = in.readString();
mName = in.readString();
- if(in.readInt()==0)
- mUserEditable=false;
- else
- mUserEditable=true;
+ mUserEditable = in.readInt() != 0;
}
public APIVpnProfile(String uuidString, String name, boolean userEditable) {
diff --git a/src/de/blinkt/openvpn/api/ExternalAppDatabase.java b/src/de/blinkt/openvpn/api/ExternalAppDatabase.java
index e640a13a..02c369b1 100644
--- a/src/de/blinkt/openvpn/api/ExternalAppDatabase.java
+++ b/src/de/blinkt/openvpn/api/ExternalAppDatabase.java
@@ -26,9 +26,8 @@ public class ExternalAppDatabase {
}
public Set<String> getExtAppList() {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
- Set<String> allowedapps = prefs.getStringSet(PREFERENCES_KEY, new HashSet<String>());
- return allowedapps;
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
+ return prefs.getStringSet(PREFERENCES_KEY, new HashSet<String>());
}
void addApp(String packagename)
diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java
index 866fb698..35374c77 100644
--- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java
+++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java
@@ -76,7 +76,8 @@ public class ExternalOpenVPNService extends Service implements StateListener {
}
private final IOpenVPNAPIService.Stub mBinder = new IOpenVPNAPIService.Stub() {
- private boolean checkOpenVPNPermission() throws SecurityRemoteException{
+
+ private void checkOpenVPNPermission() throws SecurityRemoteException{
PackageManager pm = getPackageManager();
for (String apppackage:mExtAppDb.getExtAppList()) {
@@ -84,7 +85,7 @@ public class ExternalOpenVPNService extends Service implements StateListener {
try {
app = pm.getApplicationInfo(apppackage, 0);
if (Binder.getCallingUid() == app.uid) {
- return true;
+ return;
}
} catch (NameNotFoundException e) {
// App not found. Remove it from the list
@@ -299,7 +300,7 @@ public class ExternalOpenVPNService extends Service implements StateListener {
{
broadcastItem.newStatus(um.vpnUUID, um.state, um.logmessage, um.level.name());
}
- };
+ }
} \ No newline at end of file