Skip to content

Commit

Permalink
fix(Sensor): return unknow instead empty the type function
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelje authored and ajsb85 committed Jul 27, 2017
1 parent 2177121 commit 378cc8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion inventory/src/main/java/com/flyvemdm/inventory/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ private Utils() {
}

public static boolean isEmulator() {
return Build.HARDWARE.contains("golfdish");
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
|| "google_sdk".equals(Build.PRODUCT);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public String getType(Sensor s) {
strtype = "ROTATION VECTOR";
break;
default:
strtype = "";
strtype = "Unknow";
break;
}
return strtype;
Expand Down

0 comments on commit 378cc8d

Please sign in to comment.