android: fix when there's no permission, crash will happen

This commit is contained in:
pengfei.zhou 2021-11-11 14:12:13 +08:00 committed by osborn
parent fb65b35b7b
commit f448692896

View File

@ -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) {
return notHasBlueTooth() try {
|| notHasLightSensorManager(context) return notHasBlueTooth()
|| isFeatures() || notHasLightSensorManager(context)
|| checkIsNotRealPhone() || isFeatures()
|| checkPipes(); || checkIsNotRealPhone()
|| checkPipes();
} catch (Throwable e) {
e.printStackTrace();
return false;
}
} }
private static boolean notHasBlueTooth() { private static boolean notHasBlueTooth() {