introduce programatic flavor recognition

This commit is contained in:
Domingos Lopes 2016-06-04 11:40:05 -04:00
parent a2d3e83440
commit f84f40d350
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package de.danoeh.antennapod.core.util;
import de.danoeh.antennapod.core.BuildConfig;
/**
* Helper class to handle the different build flavors.
*/
public enum Flavors {
FREE,
PLAY,
UNKNOWN;
public static final Flavors FLAVOR;
static {
if (BuildConfig.FLAVOR.equals("free")) {
FLAVOR = FREE;
} else if (BuildConfig.FLAVOR.equals("play")) {
FLAVOR = PLAY;
} else {
FLAVOR = UNKNOWN;
}
}
}