-
Notifications
You must be signed in to change notification settings - Fork 215
/
DeviceType.java
46 lines (38 loc) · 1.4 KB
/
DeviceType.java
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.mozilla.vrbrowser.utils;
import android.util.Log;
import org.mozilla.vrbrowser.BuildConfig;
public class DeviceType {
// These values need to match those in Device.h
public static final int Unknown = 0;
public static final int OculusGo = 1;
public static final int OculusQuest = 2;
private static int mType = Unknown;
public static void setType(int aType) {
String name = "Unknown Type";
if (aType == OculusGo) {
name = "Oculus Go";
} else if (aType == OculusQuest) {
name = "Oculus Quest";
}
Log.d("VRB", "Setting device type to: " + name);
mType = aType;
}
public static int getType() {
return mType;
}
public static boolean isOculusBuild() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("oculusvr");
}
public static boolean isOculus6DOFBuild() {
return BuildConfig.FLAVOR_platform.equalsIgnoreCase("oculusvr") || BuildConfig.FLAVOR_platform.equalsIgnoreCase("oculusvrStore");
}
public static boolean isWaveBuild() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("wavevr");
}
public static boolean isGoogleVR() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("googlevr");
}
public static boolean isPicoVR() {
return BuildConfig.FLAVOR_platform.toLowerCase().contains("picovr");
}
}