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) {
|
||||||
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() {
|
||||||
|
Reference in New Issue
Block a user