Skip to content

Commit

Permalink
Ensure mobile_context only contains accepted enum values (fixes #232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeemster committed Oct 3, 2016
1 parent 419ae6d commit d24eb73
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,15 @@ public static String getAndroidIdfa(Context context) {
public static String getNetworkType(NetworkInfo networkInfo) {
String networkType = null;
if (networkInfo != null) {
networkType = networkInfo.getTypeName().toLowerCase();
String maybeNetworkType = networkInfo.getTypeName().toLowerCase();
switch (maybeNetworkType) {
case "mobile":
case "wifi":
case "offline":
networkType = maybeNetworkType;
break;
default: break;
}
}
return networkType;
}
Expand Down

0 comments on commit d24eb73

Please sign in to comment.