Skip to content

Commit

Permalink
Merge pull request codebutler#63 from phcoder/mfc
Browse files Browse the repository at this point in the history
Add possiblity for blacklist and whitelist phones for MFC support.
  • Loading branch information
micolous authored Aug 7, 2018
2 parents 6dc782e + 0fbcbc9 commit cd53830
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/au/id/micolous/metrodroid/MetrodroidApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Set;

import au.id.micolous.farebot.R;
import au.id.micolous.metrodroid.card.Card;
Expand Down Expand Up @@ -85,6 +87,12 @@ public class MetrodroidApplication extends Application {
public static final String PREF_LOCALISE_PLACES = "pref_localise_places";
public static final String PREF_LOCALISE_PLACES_HELP = "pref_localise_places_help";
public static final String PREF_CONVERT_TIMEZONES = "pref_convert_timezones";
private static final Set<String> devicesMifareWorks = new HashSet<>();
private static final Set<String> devicesMifareNotWorks = new HashSet<>();

static {
devicesMifareWorks.add("Pixel 2");
}

private static MetrodroidApplication sInstance;

Expand Down Expand Up @@ -279,6 +287,16 @@ private void detectNfcSupport() {
return;
}

if (devicesMifareNotWorks.contains(android.os.Build.MODEL)) {
mMifareClassicSupport = false;
return;
}

if (devicesMifareWorks.contains(android.os.Build.MODEL)) {
mMifareClassicSupport = true;
return;
}

// TODO: Some devices report MIFARE Classic support, when they actually don't have it.
//
// Detecting based on libraries and device nodes doesn't work great either. There's edge
Expand Down

0 comments on commit cd53830

Please sign in to comment.