Browse Source

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>
master
Samuel Holland 7 years ago
parent
commit
d8a5ec3f19
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      app/src/main/java/com/wireguard/android/ProfileService.java

+ 7
- 1
app/src/main/java/com/wireguard/android/ProfileService.java View File

@@ -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


Loading…
Cancel
Save