-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pico OpenXR runtime had several issues over the time. We had to add workarounds here and there to support those OS versions. As time passes by those workarounds just make the code more complex to maintain without any real benefit (as it affects really old versions of the OS). After this change Pico OS versions < v5.7.1 are no longer supported and Wolvic will refuse to start. This allows us to remove a lot of code workarounding runtime bugs including the legacy hand mesh renderer using spheres.
- Loading branch information
Showing
10 changed files
with
38 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 36 additions & 2 deletions
38
app/src/picoxr/java/com/igalia/wolvic/PlatformSystemCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,44 @@ | ||
package com.igalia.wolvic; | ||
|
||
import android.util.Log; | ||
|
||
import com.igalia.wolvic.utils.SystemUtils; | ||
|
||
public class PlatformSystemCheck extends SystemCheck { | ||
private static final String PICO_OS_VERSION_PROPERTY = "ro.build.display.id"; | ||
private static final int MIN_PICO_OS_MAJOR_VERSION = 5; | ||
private static final int MIN_PICO_OS_MINOR_VERSION = 7; | ||
private static final int MIN_PICO_OS_PATCH_VERSION = 1; | ||
private static final String LOGTAG = SystemUtils.createLogtag(PlatformSystemCheck.class); | ||
|
||
/** | ||
* Compares two version strings in the form x.y.z where x, y, and z are integers. | ||
* @return a negative integer, zero, or a positive integer as the first version | ||
* is less than, equal to, or greater than the second version. | ||
*/ | ||
private int compare(String str1, String str2) { | ||
String[] parts1 = str1.split("\\."); | ||
String[] parts2 = str2.split("\\."); | ||
|
||
for (int i = 0; i < Math.min(parts1.length, parts2.length); i++) { | ||
int num1 = Integer.parseInt(parts1[i]); | ||
int num2 = Integer.parseInt(parts2[i]); | ||
|
||
if (num1 != num2) | ||
return num1 - num2; | ||
} | ||
return parts1.length - parts2.length; | ||
} | ||
|
||
@Override | ||
public boolean isOSVersionCompatible() { return true; } | ||
public boolean isOSVersionCompatible() { | ||
String osVersion = getSystemProperty(PICO_OS_VERSION_PROPERTY); | ||
Log.i(LOGTAG, "Checking that OS version is at least " + minSupportedVersion() + " (found " + osVersion + ")"); | ||
return compare(osVersion, minSupportedVersion()) >= 0; | ||
} | ||
|
||
@Override | ||
public String minSupportedVersion() { return ""; } | ||
public String minSupportedVersion() { | ||
return MIN_PICO_OS_MAJOR_VERSION + "." + MIN_PICO_OS_MINOR_VERSION + "." + MIN_PICO_OS_PATCH_VERSION; | ||
} | ||
} |