android: fix when there's no permission, crash will happen
This commit is contained in:
parent
fb65b35b7b
commit
f448692896
@ -30,11 +30,16 @@ import java.io.InputStreamReader;
|
|||||||
|
|
||||||
public class SimulatorUtil {
|
public class SimulatorUtil {
|
||||||
public static boolean isSimulator(Context context) {
|
public static boolean isSimulator(Context context) {
|
||||||
|
try {
|
||||||
return notHasBlueTooth()
|
return notHasBlueTooth()
|
||||||
|| notHasLightSensorManager(context)
|
|| notHasLightSensorManager(context)
|
||||||
|| isFeatures()
|
|| isFeatures()
|
||||||
|| checkIsNotRealPhone()
|
|| checkIsNotRealPhone()
|
||||||
|| checkPipes();
|
|| checkPipes();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean notHasBlueTooth() {
|
private static boolean notHasBlueTooth() {
|
||||||
|
Reference in New Issue
Block a user