summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-07-30 02:18:17 -0500
committerSamuel Holland <samuel@sholland.org>2017-07-30 02:18:17 -0500
commitd8a5ec3f1999cb07e5f5677ba2f87910d96da98b (patch)
tree289856183301e4c21c17f23eb764f3a5ecc7d867 /app/src/main/java
parentc65ac9fafe5a0978c5976ef9ae666e67b4efe796 (diff)
ProfileService: Only load from files ending with .conf
This condition was previously enforced in the AsyncTask, but was lost in the move from ProfileListActivity to ProfileService. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/wireguard/android/ProfileService.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/ProfileService.java b/app/src/main/java/com/wireguard/android/ProfileService.java
index 172f230c..faecde72 100644
--- a/app/src/main/java/com/wireguard/android/ProfileService.java
+++ b/app/src/main/java/com/wireguard/android/ProfileService.java
@@ -12,6 +12,7 @@ import android.util.Log;
import com.wireguard.config.Profile;
import java.io.File;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
@@ -33,7 +34,12 @@ public class ProfileService extends Service {
@Override
public void onCreate() {
- new ProfileLoader().execute(getFilesDir().listFiles());
+ new ProfileLoader().execute(getFilesDir().listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".conf");
+ }
+ }));
}
@Override