forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlatform.java
More file actions
28 lines (23 loc) · 726 Bytes
/
Copy pathPlatform.java
File metadata and controls
28 lines (23 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package io.sentry.util;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public final class Platform {
private static boolean isAndroid;
static {
// System#getProperty can throw an exception if there is a security manager is configured and
// does not allow accessing system properties
try {
// All system properties on Android:
// https://developer.android.com/reference/java/lang/System#getProperties()
isAndroid = "The Android Project".equals(System.getProperty("java.vendor"));
} catch (Throwable e) {
isAndroid = false;
}
}
public static boolean isAndroid() {
return isAndroid;
}
public static boolean isJvm() {
return !isAndroid;
}
}