diff options
author | Samuel Holland <samuel@sholland.org> | 2017-07-30 02:18:17 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-07-30 02:18:17 -0500 |
commit | f67247cd7d9f7db0f3e78bd4f34f4c109f518c14 (patch) | |
tree | 289856183301e4c21c17f23eb764f3a5ecc7d867 /app/src | |
parent | 09a61d81b2285bdfbe2437a17b4999b59fd70571 (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.
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ProfileService.java | 8 |
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 |